home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Family Forum 256
/
DR_BRAIN.BIN
/
SHARED.DIR
/
02000_Script_FatLips
Wrap
Text File
|
1997-01-16
|
15KB
|
472 lines
-- ChannelVoice(channel for mouth, --> ##** ##00 Sprite to Center on / ** Channel for Mouth
-- castname of Mouths, --> Ex: "Clown" would cause "AClown" to be the A Mouth Cast
-- sound castname, --> This is the cast name of the Sound to sinc.
-- speach string, --> Use only lower case letters for the matching string
-- sampling rate) --> Enter 11 for 11mHz / 22 for 22mHz
-- PuppetVoice(channel,castname,sound castname,speach string,sampling rate) ***See Above***
-- VoiceUpKeep ***Global Var: VoiceState 0=Quiet/1=Talking***
-- VoicePreset(castname)
-- NoVoice (Which Channels 2=stop both channels)
-- ***Call this to shut-up VoiceState2 and call from the StopMovie***
-- ChannelVoice2(channel,castname,sound castname,speach string,sampling rate) ***See Above***
-- PuppetVoice2(channel,castname,sound castname,speach string,sampling rate) ***See Above***
-- VoiceUpKeep2 ***Global Var: VoiceState2 0=Quiet/1=Talking***
-- VoicePreset2(castname)
-- NoVoice2 (Which Channels 2=stop both channels)
-- ***Call this to shut-up VoiceState2 and call from the StopMovie***
-- ClearVoices ***Call this in your StartMovie***
On ChannelVoice where,who,saywhat,what,sample
global voicestate,mouthoff,voicegraph,soundgraph,voicestring,voicelength,voicespot,voicestep
global oldtime,oldmouth,oldface,facespot,oldxface,oldyface,lastvoice
if sample=11 then
set sample = 11025
end if
if sample=22 then
set sample = 22050
end if
set voicestate = 1
if lastvoice<>who then
set mouthindex = [2,8,6,11,3,10,6,11,2,5,6,9,8,6,4,8,7,6,6,11,5,10,7,3,6,6,1]
set stuffumouth = ["","A","E","O","U","C","W","M","L","F"]
set tempmouth = [0,0,0,0,0,0,0,0,0,0]
repeat with xxx = 1 to 10
set bbb = getat(stuffumouth,xxx)&who
set bee = the number of cast bbb
preloadcast(bee)
setat tempmouth,xxx,bee
end repeat
set voicegraph = []
repeat with xxx = 1 to 27
set aaa = getat(mouthindex,xxx)
if aaa = 11 then
set ccc = 0
else
set ccc = getat(tempmouth,aaa)
end if
append voicegraph,ccc
end repeat
set lastvoice=who
end if
set soundgraph = the number of cast saywhat
set voicestring = what
set oldxface = -2000
set oldyface = -2000
set facespot = integer(where/100)
set voicespot = where-(facespot*100)
set ddd = getat(voicegraph,27)
if soundgraph = 0 or ddd = 0 then
set voicestate = 0
exit
end if
puppetsprite voicespot,1
set voicelength = THE SIZE OF CAST SOUNDGRAPH + .01
SET VOICEstep = float((VOICELENGTH*60)/SAMPLE)/float(LENGTH(WHAT))
set voicelength = float(voicelength/sample)*60.00001
set oldtime = mouthoff
set oldmouth = 20000
set oldface = ddd
set mouthoff = the timer
voiceupkeep
End ChannelVoice
On PuppetVoice where,who,saywhat,what,sample
global voicestate,mouthoff,voicegraph,soundgraph,voicestring,voicelength,voicespot,voicestep
global oldtime,oldmouth,oldface,facespot,oldxface,oldyface,lastvoice,jellyjam
if sample=11 then
set sample = 11025
end if
if sample=22 then
set sample = 22050
end if
set voicestate = 1
if lastvoice<>who or lastvoice=jellyjam then
set mouthindex = [2,8,6,11,3,10,6,11,2,5,6,9,8,6,4,8,7,6,6,11,5,10,7,3,6,6,1]
set stuffumouth = ["","A","E","O","U","C","W","M","L","F"]
set tempmouth = [0,0,0,0,0,0,0,0,0,0]
repeat with xxx = 1 to 10
set bbb = getat(stuffumouth,xxx)&who
set bee = the number of cast bbb
preloadcast(bee)
setat tempmouth,xxx,bee
end repeat
set voicegraph = []
repeat with xxx = 1 to 27
set aaa = getat(mouthindex,xxx)
if aaa = 11 then
set ccc = 0
else
set ccc = getat(tempmouth,aaa)
end if
append voicegraph,ccc
end repeat
set lastvoice=who
end if
set soundgraph = the number of cast saywhat
set voicestring = what
set oldxface = -2000
set oldyface = -2000
set facespot = integer(where/100)
set voicespot = where-(facespot*100)
set ddd = getat(voicegraph,27)
if soundgraph = -1 or ddd = 0 then
set voicestate = 0
exit
end if
puppetsprite voicespot,1
set voicelength = THE SIZE OF CAST SOUNDGRAPH + .01
SET VOICEstep = float((VOICELENGTH*60)/SAMPLE)/float(LENGTH(WHAT))
set voicelength = float(voicelength/sample)*60.00001
set oldtime = mouthoff
set oldmouth = 20000
set oldface = ddd
puppetsound saywhat
updatestage
-- if the machinetype = 256 then
-- set temp = the timer
-- repeat while the timer < (temp + 15)
-- updatestage
-- end repeat
-- end if
set mouthoff = the timer
VoiceUpKeep
End PuppetVoice
On VoiceUpKeep
global voicestate,mouthoff,voicegraph,soundgraph,voicestring,voicelength,voicespot,voicestep
global oldtime,oldmouth,oldface,facespot,oldxface,oldyface
if voicestate = 1 then
if facespot > 0 then
set xxx = the loch of sprite facespot
set yyy = the locv of sprite facespot
if xxx <> oldxface or yyy <> oldyface then
set the loch of sprite voicespot = xxx
set the locv of sprite voicespot = yyy
set oldxface = xxx
set oldyface = yyy
end if
end if
set timefor = the timer
set ack = timefor - mouthoff
if ack < 0 then
set mouthoff = mouthoff - oldtime
set ack = timefor - mouthoff
end if
if ack > voicelength then
novoice
exit
end if
set oldtime = timefor
set pbsst = integer(ack / voicestep)+1
if pbsst = oldmouth then
exit
end if
set oldmouth = pbsst
set inchar = char pbsst of voicestring
set invalue = chartonum(inchar)
set newface = 0
if inchar = " " then
set newface = getat(voicegraph,27)
else
if invalue >64 and invalue < 91 then
set newface = getat(voicegraph,(invalue-64))
else
if invalue > 96 and invalue < 124 then
set newface = getat(voicegraph,(invalue-96))
end if
end if
end if
if newface = 0 then
set pink = random(13)
if pink = 11 then
set newface = getat(voicegraph,3)
else
if pink > 11 then
set newface = getat(voicegraph,12)
else
set newface = getat(voicegraph,9)
end if
end if
end if
if newface = 0 or newface = oldface then
exit
end if
set the castnum of sprite voicespot = newface
set oldface = newface
end if
End VoiceUpKeep
On ClearVoices
global lastvoice,lastvoice2
set lastvoice = "Illbedamned"
set lastvoice2 = "Illbedamned"
End ClearVoices
On VoicePreset who
global lastvoice,voicegraph
if lastvoice<>who then
set mouthindex = [2,8,6,11,3,10,6,11,2,5,6,9,8,6,4,8,7,6,6,11,5,10,7,3,6,6,1]
set stuffumouth = ["","A","E","O","U","C","W","M","L","F"]
set tempmouth = [0,0,0,0,0,0,0,0,0,0]
repeat with xxx = 1 to 10
set bbb = getat(stuffumouth,xxx)&who
set bee = the number of cast bbb
preloadcast(bee)
setat tempmouth,xxx,bee
end repeat
set voicegraph = []
repeat with xxx = 1 to 27
set aaa = getat(mouthindex,xxx)
if aaa = 11 then
set ccc = 0
else
set ccc = getat(tempmouth,aaa)
end if
append voicegraph,ccc
end repeat
set lastvoice=who
end if
End VoicePreset
On NoVoice Channel
global voicestate,voicespot,voicegraph
if voicestate > 0 then
set the castnum of sprite voicespot = getat(voicegraph,27)
set voicestate=0
if channel = 2 then
sound STOP 2
end if
puppetsound 0
puppetsprite voicespot,0
end if
puppetsprite voicespot,0
End NoVoice
On ChannelVoice2 where2,who2,saywhat2,what2,sample2
global voicestate2,mouthoff2,voicegraph2,soundgraph2,voicestring2,voicelength2,voicespot2,voicestep2
global oldtime2,oldmouth2,oldface2,facespot2,oldxface2,oldyface2,lastvoice2
if sample2=11 then
set sample2 = 11025
end if
if sample2=22 then
set sample2 = 22050
end if
set voicestate2 = 1
if lastvoice2<>who2 then
set mouthindex2 = [2,8,6,11,3,10,6,11,2,5,6,9,8,6,4,8,7,6,6,11,5,10,7,3,6,6,1]
set stuffumouth2 = ["","A","E","O","U","C","W","M","L","F"]
set tempmouth2 = [0,0,0,0,0,0,0,0,0,0]
repeat with xxx2 = 1 to 10
set bbb2 = getat(stuffumouth2,xxx2)&who2
set bee2 = the number of cast bbb2
preloadcast(bee2)
setat tempmouth2,xxx2,bee2
end repeat
set voicegraph2 = []
repeat with xxx2 = 1 to 27
set aaa2 = getat(mouthindex2,xxx2)
if aaa2 = 11 then
set ccc2 = 0
else
set ccc2 = getat(tempmouth2,aaa2)
end if
append voicegraph2,ccc2
end repeat
set lastvoice2=who2
end if
set soundgraph2 = the number of cast saywhat2
set voicestring2 = what2
set oldxface2 = -2000
set oldyface2 = -2000
set facespot2 = integer(where2/100)
set voicespot2 = where2-(facespot2*100)
set ddd2 = getat(voicegraph2,27)
if soundgraph2 = 0 or ddd2 = 0 then
set voicestate2 = 0
exit
end if
puppetsprite voicespot2,1
set voicelength2 = THE SIZE OF CAST SOUNDGRAPH2 + .01
SET VOICEstep2 = float((VOICELENGTH2*60)/SAMPLE2)/float(LENGTH(WHAT2))
set voicelength2 = float(voicelength2/sample2)*60.00001
set oldtime2 = mouthoff2
set oldmouth2 = 20000
set oldface2 = ddd2
set mouthoff2 = the timer
voiceupkeep2
End ChannelVoice2
On PuppetVoice2 where2,who2,saywhat2,what2,sample2
global voicestate2,mouthoff2,voicegraph2,soundgraph2,voicestring2,voicelength2,voicespot2,voicestep2
global oldtime2,oldmouth2,oldface2,facespot2,oldxface2,oldyface2,lastvoice2
if sample2=11 then
set sample2 = 11025
end if
if sample2=22 then
set sample2 = 22050
end if
set voicestate2 = 1
if lastvoice2<>who2 then
set mouthindex2 = [2,8,6,11,3,10,6,11,2,5,6,9,8,6,4,8,7,6,6,11,5,10,7,3,6,6,1]
set stuffumouth2 = ["","A","E","O","U","C","W","M","L","F"]
set tempmouth2 = [0,0,0,0,0,0,0,0,0,0]
repeat with xxx2 = 1 to 10
set bbb2 = getat(stuffumouth2,xxx2)&who2
set bee2 = the number of cast bbb2
preloadcast(bee2)
setat tempmouth2,xxx2,bee2
end repeat
set voicegraph2 = []
repeat with xxx2 = 1 to 27
set aaa2 = getat(mouthindex2,xxx2)
if aaa2 = 11 then
set ccc2 = 0
else
set ccc2 = getat(tempmouth2,aaa2)
end if
append voicegraph2,ccc2
end repeat
set lastvoice2=who2
end if
set soundgraph2 = the number of cast saywhat2
set voicestring2 = what2
set oldxface2 = -2000
set oldyface2 = -2000
set facespot2 = integer(where2/100)
set voicespot2 = where2-(facespot2*100)
set ddd2 = getat(voicegraph2,27)
if soundgraph2 = 0 or ddd2 = 0 then
novoice2
exit
end if
puppetsprite voicespot2,1
set voicelength2 = THE SIZE OF CAST SOUNDGRAPH2 + .01
SET VOICEstep2 = float((VOICELENGTH2*60)/SAMPLE2)/float(LENGTH(WHAT2))
set voicelength2 = float(voicelength2/sample2)*60.00001
set oldtime2 = mouthoff2
set oldmouth2 = 20000
set oldface2 = ddd2
puppetsound saywhat2
set mouthoff2 = the timer
VoiceUpKeep2
End PuppetVoice2
On VoiceUpKeep2
global voicestate2,mouthoff2,voicegraph2,soundgraph2,voicestring2,voicelength2,voicespot2,voicestep2
global oldtime2,oldmouth2,oldface2,facespot2,oldxface2,oldyface2
if voicestate2 = 1 then
if facespot2 > 0 then
set xxx2 = the loch of sprite facespot2
set yyy2 = the locv of sprite facespot2
if xxx2 <> oldxface2 or yyy2 <> oldyface2 then
set the loch of sprite voicespot2 = xxx2
set the locv of sprite voicespot2 = yyy2
set oldxface2 = xxx2
set oldyface2 = yyy2
end if
end if
set timefor2 = the timer
set ack2 = timefor2 - mouthoff2
if ack2 < 0 then
set mouthoff2 = mouthoff2 - oldtime2
set ack2 = timefor2 - mouthoff2
end if
if ack2 > voicelength2 then
novoice2
exit
end if
set oldtime2 = timefor2
set pbsst2 = integer(ack2 / voicestep2)+1
if pbsst2 = oldmouth2 then
exit
end if
set oldmouth2 = pbsst2
set inchar2 = char pbsst2 of voicestring2
set invalue2 = chartonum(inchar2)
set newface2 = 0
if inchar2 = " " then
set newface2 = getat(voicegraph2,27)
else
if invalue2 >64 and invalue2 < 91 then
set newface2 = getat(voicegraph2,(invalue2-64))
else
if invalue2 > 96 and invalue2 < 124 then
set newface2 = getat(voicegraph2,(invalue2-96))
end if
end if
end if
if newface2 = 0 then
set pink2 = random(13)
if pink2 = 11 then
set newface2 = getat(voicegraph2,3)
else
if pink2 > 11 then
set newface2 = getat(voicegraph2,12)
else
set newface2 = getat(voicegraph2,9)
end if
end if
end if
if newface2 = 0 or newface2 = oldface2 then
exit
end if
set the castnum of sprite voicespot2 = newface2
set oldface2 = newface2
end if
End VoiceUpKeep2
On VoicePreset2 who2
global lastvoice2,voicegraph2
if lastvoice2<>who2 then
set mouthindex2 = [2,8,6,11,3,10,6,11,2,5,6,9,8,6,4,8,7,6,6,11,5,10,7,3,6,6,1]
set stuffumouth2 = ["","A","E","O","U","C","W","M","L","F"]
set tempmouth2 = [0,0,0,0,0,0,0,0,0,0]
repeat with xxx2 = 1 to 10
set bbb2 = getat(stuffumouth2,xxx2)&who2
set bee2 = the number of cast bbb2
preloadcast(bee2)
setat tempmouth2,xxx2,bee2
end repeat
set voicegraph2 = []
repeat with xxx2 = 1 to 27
set aaa2 = getat(mouthindex2,xxx2)
if aaa2 = 11 then
set ccc2 = 0
else
set ccc2 = getat(tempmouth2,aaa2)
end if
append voicegraph2,ccc2
end repeat
set lastvoice2=who2
end if
End VoicePreset2
On NoVoice2 Channel2
global voicestate2,voicespot2,voicegraph2
if voicestate2 > 0 then
set the castnum of sprite voicespot2 = getat(voicegraph2,27)
set voicestate2=0
if channel2 = 2 then
sound STOP 2
end if
puppetsound 0
puppetsprite voicespot2,0
end if
End NoVoice2