home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Inventor Labs: Technology
/
INVENTORLABS_TECHNOLOGY.BIN
/
pc
/
files
/
bell.dir
/
00325_Script_TelephoneParentScript
< prev
next >
Wrap
Text File
|
1997-05-26
|
19KB
|
559 lines
-- Telephone Object Parent Script
--Instantiated as gTel
property pMouthPieceTracker -- #MOUTHPIECEON or #MOUTHPIECEOFF
property pMouthCastList -- list of castNums for the mouthpiece sprite
property pBottleCastList --list of castNums for the bottles
property pZoomNeedleSprite -- sprite channel for the QT of the interactive needle
property pLastNeedlePosition -- last position that the needle was in
property pZoomNeedleCast -- cast number for the QT of the needle
property pZoomNeedleH --locH of the needleQT
property pZoomNeedleV --locV of the needle QT
property pMouthPieceID -- which actual mouthpiece is on the stand. It is a number from 1 to 3, or #NOMOUTHPIECE if there is nothing on there
property pLiquidID -- #COD, #WAT, or #ACD
property pLiquidIDList -- list of all three liquid ID's
property pNeedleID -- needle position 1, 2, 3, or 4
property pResolutionSymbol -- used to get values out of property list
property pResolutionSound -- string that tell which AIF file to play for outcome sound
property pResolutionHint -- string that tell which AIF file to play for hint
property pResolutionNeedleDurationList -- list of QT durations for needles vibrating in solution
property pCurrentResolutionNeedleStopTime --current QT duration of the vibrating needle
property pResolutionNeedleSprite -- sprite of the QT vibrating needle
property pResolutionVibrationDuration --duration QT of the speaker vibrating
property pResolutionVibrationSprite -- sprite of the speaker vibrating
property pRewardSprite -- sprite of the QT reward video with Bell
property pRewardStopTime -- duration of the QT Reward video
property pRewardList -- list of the three possible reward videos with Bell
property pNumberOfTrials, pBottleQTSprite --tracks the number of times that the test button has been hit
----------------<<ò>>
--JOURNAL PROPS
----------------<<ò>>
property pCorrectX, pCorrectY, pCorrectZ, pTestRecord
global gSndPath, gUtilityObj, gJournalObj, gInterfaceMgrObj
property pQTList, pMouthSprite, pMouthCastStart, pOutcomeList, pHintList, pZoomed, pMainCursor
property pBottleCapStartCast, pBottleQTstartCast, pQTsprite, pQTbottleStage
property pCurrentBottle, pCurrentMouthPiece, pBottleSprite, pNeedlePosition, pNewBottle
property pSndPlaying, pWhatHintFile, pBottleQTrect, pMouthStartSprite, pBottleStartSprite
property pRolloverStartsprite, pRolloverEndSprite, plabels, pOutcomeSndFile
on mInit me
cursor 4
set pBottleSprite = 16
set pMouthSprite = 15
set pQTsprite = 20
set pMouthStartSprite = 9
set pBottleStartSprite = 5
set pBottleCapStartCast = the number of cast "BottleCap1"
set pBottleQTstartCast = the number of cast "BTECAP1b.MOV"
set pMouthCastStart =the number of cast "mouthPiece1"
set pOutcomeList = value( line 1 of the text of cast "BYS db")
set pHintList = value( line 2 of the text of cast "BYS db")
set pSndPlaying = #NONE
set pBottleQTrect = rect(157, 274, 257, 302)
set pLiquidIDList = [#COD, #WAT, #ACD]
--JOURNAL PROPS
set pCorrectX = 3
set pCorrectY = 2
set pCorrectZ = 3
set pTestRecord = []
repeat with x = 1 to 36
add(pTestRecord, 0)
end repeat
return me
end
-------------------------------------------------------------------------------------------------------------------
on mActivate me
sound playfile 2, gSndPath & "BTEINTR.AIF"
puppetsprite pMouthSprite, true
puppetsprite pBottleSprite, true
set pCurrentLiquid = #COD
set pNeedlePosition = 1
set pCurrentBottle = 1
set pCurrentMouthPiece = 1
set pQTbottleStage = #NOTACTIVE
set pNumberOfTrials = 0
set pZoomed = FALSE
mInformJournal(gJournalObj, #ArrivingAtBIY)
mSetToolBtns (gInterfaceMgrObj, #BBYS, me)
set pMainCursor = [21:#RETURN,22:#RETURN,13:#ZOOMIN,12:#Speak]
repeat with counter = pMouthStartSprite to pMouthStartSprite + 2
addprop( pMainCursor,counter,#operate)
end repeat
repeat with counter = pBottleStartSprite to pBottleStartSprite + 2
addprop( pMainCursor,counter,#operate)
end repeat
mSetCursors( gUtilityObj, pMainCursor)
mUnSetOneCursor( gUtilityObj, pMouthStartSprite + pCurrentMouthPiece - 1)
mUnSetOneCursor( gUtilityObj, pBottleStartSprite + pCurrentBottle - 1)
mSetRollover( me, #main )
cursor -1
end
-------------------------------------------------------------------------------------------------------------------
on mOperate me, whatSelection
sound stop 1
sound stop 2
if (whatSelection = 1) then
set MouthPiece = pCurrentMouthPiece - 1
if MouthPiece <= 0 then set MouthPiece = 3
if pZoomed then mPullout me
mMouthPiece me, MouthPiece
else if (whatSelection = 2) then
set bottlePosition = pCurrentBottle - 1
if bottlePosition <= 0 then set bottlePosition = 3
if pZoomed then mPullout me
mBottleClicked me, bottlePosition
else if (whatSelection = 3) then
set NewNeedle = pNeedlePosition -1
if NewNeedle <= 0 then set NewNeedle = 1
if not pZoomed then mZoomNeedle me
mSetNeedlePoint me, NewNeedle
else if (whatSelection = 4) then
set MouthPiece = pCurrentMouthPiece + 1
if MouthPiece >= 4 then set MouthPiece = 1
if pZoomed then mPullout me
mMouthPiece me, MouthPiece
else if (whatSelection = 5) then
set bottlePosition = pCurrentBottle + 1
if bottlePosition >= 4 then set bottlePosition = 1
if pZoomed then mPullout me
mBottleClicked me, bottlePosition
else if (whatSelection = 6) then
set NewNeedle = pNeedlePosition + 1
if NewNeedle >= 4 then set NewNeedle = 4
if not pZoomed then mZoomNeedle me
mSetNeedlePoint me, NewNeedle
else if (whatSelection = 7) then
mResolution me
end if
mClearToolHilite (gInterfaceMgrObj)
end mOperate
-------------------------------------------------------------------------------------------------------------------
on mZoom me, whatSelection
mZoomNeedle(me)
mClearToolHilite (gInterfaceMgrObj)
end mZoom
-------------------------------------------------------------------------------------------------------------------
on mClose me
puppetsprite pBottleSprite, false
puppetsprite pMouthSprite, false
puppetsprite pQTsprite, false
mInformJournal(gJournalObj, #LeavingBIY)
end mClose
----------------------------------------------------------------------
on mSetRollover me, whatarea
if whatarea = #main then
set pRolloverStartsprite = 4
set pRolloverEndSprite = 11
set plabels = the text of cast "Tele rollover text"
else if whatarea = #Needle then
set pRolloverStartsprite = 6
set pRolloverEndSprite = 10
set plabels = the text of cast "Needle Labels"
end if
end mSetRollover
----------------------------------------------------------------------
on mMouthPiece me, mouthPosition
sound stop 2
if (mouthPosition <> pCurrentMouthPiece) then
set tempcurlst = [:]
addProp (tempcurlst,(pMouthStartSprite + pCurrentMouthPiece - 1),#OPERATE)
mSetCursors( gUtilityObj, tempcurlst )
set pCurrentMouthPiece = mouthPosition
mUnSetOneCursor( gUtilityObj, pMouthStartSprite + pCurrentMouthPiece - 1)
set the castNum of sprite pMouthSprite = (pMouthCastStart - 1) + pCurrentMouthPiece
updatestage
end if
end mMouthPiece
----------------------------------------------------------------------
on mBottleClicked me, bottlePosition
if (bottlePosition <> pCurrentBottle) then
puppetsprite pQTsprite, true
set pNewBottle = bottlePosition
set the castnum of sprite pQTsprite = (pBottleQTstartCast - 1) + (pCurrentBottle * 2) - 1
set the rect of sprite pQTsprite = pBottleQTrect
set pQTbottleStage = #OFF
updatestage
set the movierate of sprite pQTsprite = 1
end if
end mBottleClicked
---------------------------------------------------------------------{}
on mPerform me
if (pQTbottleStage <> #NOTACTIVE) then
set mtMonitor = the movierate of sprite pQTsprite
if (pQTbottleStage = #OFF) and ( mtMonitor = 0) then
set pQTbottleStage = #ON
set tempcurlst = [:]
addProp (tempcurlst,(pBottleStartSprite + pCurrentBottle - 1),#OPERATE)
mSetCursors( gUtilityObj, tempcurlst)
set pCurrentBottle = pNewBottle
mUnSetOneCursor( gUtilityObj, pBottleStartSprite + pCurrentBottle - 1)
set the castnum of sprite pQTsprite = (pBottleQTstartCast - 1) + (pCurrentBottle * 2)
updatestage
set the movierate of sprite pQTsprite = 1
else if (pQTbottleStage = #ON) and ( mtMonitor = 0) then
set pQTbottleStage = #NOTACTIVE
set the castnum of sprite pBottleSprite = pBottleCapStartCast - 1 + pCurrentBottle
updatestage
end if
else
set spritetoCheck = pRolloverStartsprite
set found = FALSE
repeat while (not found) and (spritetoCheck <= pRolloverEndSprite)
if rollover(spritetoCheck) then
if (spritetoCheck = 4) then set labelText = line (pCurrentMouthPiece + 5) of plabels
else if spritetoCheck = (pRolloverStartsprite + pCurrentMouthPiece + 4) then
set labelText = " "
else set labelText = line (spritetoCheck - pRolloverStartsprite + 1) of plabels
mSetLabelText( gUtilityObj, labelText)
set found = TRUE
end if
set spritetoCheck = spritetoCheck + 1
end repeat
if not found then mSetLabelText( gUtilityObj," ")
end if
go the frame
end mPerform
------------------------------------------------------------------------------------------
on mNeedleRollovers me
set spritetoCheck = pRolloverStartsprite
set found = FALSE
repeat while (not found) and (spritetoCheck <= pRolloverEndSprite)
if rollover(spritetoCheck) then
set labelText = line (spritetoCheck - pRolloverStartsprite + 1) of plabels
mSetLabelText( gUtilityObj, labelText)
set found = TRUE
end if
set spritetoCheck = spritetoCheck + 1
end repeat
if not found then mSetLabelText( gUtilityObj," ")
go the frame
end mNeedleRollovers
------------------------------------------------------------------------------------------
on mSetNeedlePoint me, NewNeedle
sound stop 2
set pNeedlePosition = NewNeedle
go frame "T_ZOOMNEEDLE" & string( pNeedlePosition )
end
------------------------------------------------------------------------------------------
on mZoomNeedle me
mUnSetCursors ( gUtilityObj )
set NeeldleCurLst = [4:#ZoomOut,21:#RETURN,22:#RETURN]
repeat with counter = 6 to 10
addprop( NeeldleCurLst, counter,#OPERATE)
end repeat
set pZoomed = TRUE
sound stop 2
puppetsprite pQTsprite, FALSE
mSetRollover( me, #Needle )
go frame "T_ZOOMNEEDLE" & string( pNeedlePosition )
mSetCursors ( gUtilityObj, NeeldleCurLst)
set the cursor of sprite 5 = -1
end
------------------------------------------------------------------------------------------
on mResolution me
mUpdateTestRecord( me )
mUnSetCursors ( gUtilityObj )
sound stop 2
sound stop 1
set pZoomed = TRUE
puppetsprite pQTsprite, FALSE
go frame "T_AUDIO" & pNeedlePosition
mSetCursors ( gUtilityObj, [21:#RETURN,22:#RETURN,18:#Zoomout])
sound playfile 2, gSndpath & "BTEAUD7.AIF"
updatestage
set the movierate of sprite pQTsprite = 1
end
------------------------------------------------------------------------------------------
on mCheckResolutionNeedle me
if (the movieRate of sprite pQTsprite = 0) and not(soundbusy(2)) then
mDelay( me, 60 )
go frame "T_VIBRATION"
else go the frame
end mCheckResolutionNeedle
-----------------------------------------------------------------------------------------
on mDelay me, howlong
set endticks = the ticks + howlong
repeat while (the ticks < endticks) and not the mousedown
updatestage
end repeat
end mDelay
-----------------------------------------------------------------------------------------
on mPlayResolutionNeedleQT me
set the movieRate of sprite pQTsprite = 1
end
------------------------------------------------------------------------------------------
on mPlayResolutionVibrationQT me
mUnSetCursors( gUtilityObj )
mSetCursors ( gUtilityObj, [21:#RETURN,22:#RETURN,18:#Zoomout])
set outcome = getat(getat(getat(pOutcomeList,pCurrentBottle),pCurrentMouthPiece),pNeedlePosition)
set pSndPlaying = #OUTCOME
set pOutcomeSndFile = "BTEAUD" & String( outcome - 1) & ".AIF"
set Hint = getat(getat(getat(pHintList,pCurrentBottle),pCurrentMouthPiece),pNeedlePosition)
set pWhatHintFile = "BTEHNT" & String( Hint) & ".AIF"
if (pOutcomeSndFile <> "BTEAUD0.AIF") then
sound playfile 2, gSndPath & pOutcomeSndFile
set the movierate of sprite pQTsprite = 1
end if
end mPlayResolutionVibrationQT
-----------------------------------------------------------------------------------------
on mCheckResolutionVibration me
if (pSndPlaying = #OUTCOME) and not(soundbusy(2)) then
set the loch of sprite pQTsprite = -1000
updatestage
puppetsprite pQTsprite, false
mUnSetCursors( gUtilityObj )
if (pOutcomeSndFile = "BTEAUD7.AIF") then
if pNumberOfTrials <= 5 then set RewardFrame = "T_VID1"
else if pNumberOfTrials <= 20 then set RewardFrame = "T_VID2"
else if pNumberOfTrials >= 21 then set RewardFrame = "T_VID3"
go frame RewardFrame
mSetCursors ( gUtilityObj, [21:#RETURN,22:#RETURN])
else
sound playfile 2, gSndPath & pWhatHintFile
set pSndPlaying = #NONE
end if
end if
go the frame
end mCheckResolutionVibration
-----------------------------------------------------------------------------------------
on mPullout me
if pZoomed then
mUnSetCursors( gUtilityObj )
set the cursor of sprite 5 = 0
set pZoomed = FALSE
sound stop 2
go "T_MAIN"
mSetRollover( me, #Main )
mSetCursors( gUtilityObj, pMainCursor)
mUnSetOneCursor( gUtilityObj, pMouthStartSprite + pCurrentMouthPiece - 1)
mUnSetOneCursor( gUtilityObj, pBottleStartSprite + pCurrentBottle - 1)
else
mClose( me )
mPullOutToArea ( gScoreEventObj )
end if
end mPullout
-----------------------------------------------------------------------------------------
on mContVid me
mUnSetCursors( gUtilityObj )
go "T_MAIN"
mSetCursors( gUtilityObj, pMainCursor)
mUnSetOneCursor( gUtilityObj, pMouthStartSprite + pCurrentMouthPiece - 1)
mUnSetOneCursor( gUtilityObj, pBottleStartSprite + pCurrentBottle - 1)
end mContVid
--------------------------------------------------------------------<<ò>>
-- JOURNAL RELATED SCRIPTS
--------------------------------------------------------------------<<ò>>
on mSwitchToJournal me
mUnSetCursors( gUtilityObj )
set the puppet of sprite pMouthSprite = 0
set the puppet of sprite pBottleSprite = 0
set the puppet of sprite pZoomNeedleSprite = 0
go frame "T_JRNL"
sound stop 1
sound stop 2
end mSwitchToJournal
--------------------------------------------------------------------<<ò>>
on mSwitchToBIY me
go frame "T_MAIN"
mSetRollover( me, #Main )
mSetCursors( gUtilityObj, pMainCursor)
mUnSetOneCursor( gUtilityObj, pMouthStartSprite + pCurrentMouthPiece - 1)
mUnSetOneCursor( gUtilityObj, pBottleStartSprite + pCurrentBottle - 1)
set the puppet of sprite pMouthSprite = 1
set the puppet of sprite pBottleSprite = 1
set the castnum of sprite pBottleSprite = pBottleCapStartCast - 1 + pCurrentBottle
set the castNum of sprite pMouthSprite = (pMouthCastStart - 1) + pCurrentMouthPiece
updateStage
end mSwitchToBIY
--------------------------------------------------------------------<<ò>>
on mUpdateTestRecord me
--x is pMouthPieceID
--y is pNeedleID
-- set pNeedlePosition = 1
-- set pCurrentBottle = 1
-- set pCurrentMouthPiece = 1
set CurrentZ = getPos (pLiquidIDList, pLiquidID)
set AdjustedMouthPieceID = mAdjustMouthPieceID (me, pCurrentMouthPiece)
set CurrentTestIndex = ((3 - AdjustedMouthPieceID) * 12) + ((pCurrentBottle - 1) * 4) + (pNeedlePosition)
setAt(pTestRecord, CurrentTestIndex, 1)
end mUpdateTestRecord
--------------------------------------------------------------------<<ò>>
on mAdjustMouthPieceID me, argWhichMouthPiece
--With better design, we can avoid this kind of nonsense:
if argWhichMouthPiece = 3 then set RealMouthPieceID = 1
else if argWhichMouthPiece = 1 then set RealMouthPieceID = 3
else set RealMouthPieceID = 2
return RealMouthPieceID
end mAdjustMouthPieceID
--------------------------------------------------------------------<<ò>>
on mUnAdjustMouthPieceID me, argWhichMouthPiece
if argWhichMouthPiece = 2 then set UnAdjustedID = 2
else if argWhichMouthPiece = 3 then set UnAdjustedID = 3
else set UnAdjustedID = 1
return UnAdjustedID
end mUnAdjustMouthPieceID
--------------------------------------------------------------------<<ò>>
on mReviewExperiment me, argRowClicked, argCollumClicked
set pCurrentMouthPiece = mUnAdjustMouthPieceID (me, argCollumClicked)
set pCurrentBottle = (((argRowClicked - 1) / 4) + 1)
set pNeedlePosition = argRowClicked mod 4
if pNeedlePosition = 0 then set pNeedlePosition = 4
mResolution me
end mReviewExperiment
--------------------------------------------------------------------<<ò>>
on mDiscloseCorrectX me
--set AdjustedCorrectMouthPiece = mAdjustMouthPieceID (me, pCorrectX)
return ( 354 )
end mDiscloseCorrectX
--------------------------------------------------------------------<<ò>>
on mDiscloseCorrectY me
return (370)
end mDiscloseCorrectY
--------------------------------------------------------------------<<ò>>
on mDiscloseCorrectZ me
return pCorrectZ
end mDiscloseCorrectZ
--------------------------------------------------------------------<<ò>>
on mDiscloseTestRecord me
return pTestRecord
end mDiscloseTestRecord
--------------------------------------------------------------------<<ò>>