113 lines
3.7 KiB
Plaintext

Tree("Root") {
Composite(Sequence) {
BTC.InitializeSpeechManager()
BTC.SetSpeechRecognitionLanguage("it-IT")
BTC.SetVoiceName("it-IT-IsabellaMultilingualNeural")
Composite(Race) {
Composite(Sequence) {
// Error in Speech Service: Cancel BTC Trees
BTC.SpeechErrorOccured()
BTC.SetBool("error")
}
RunTree("20_SBB_Story_A_Picknicken_Start")
}
Composite(Sequence) {
BTC.CompareBool("error")
// Error Handling
BTC.AbortSpeechEventListener()
BTC.StopSpeechIntentRecognition()
BTC.ClearPossbileSpeechIntents()
Composite(Marathon) {
BTC.Hide("GO.HINTS.SpeakHint")
BTC.Hide("GO.HINTS.SitDownHint")
BTC.Hide("GO.HINTS.StandUpHint")
}
Composite(Selector) {
Composite(Sequence) {
BTC.CompareSpeechError("Rate limit is exceeded")
Composite(Marathon) {
BTC.Set("TextMeshPro.HINTS.SpeechErrorTitle", "text", "Hold on")
BTC.Set("TextMeshPro.HINTS.SpeechErrorText", "text", "Der SpeechService ist momentan nicht\nverfügbar. In 30 Sekunden geht es weiter.")
BTC.Show("GO.HINTS.SpeechErrorHint")
}
BTC.Wait(30)
}
Composite(Sequence) {
Composite(Marathon) {
BTC.Set("TextMeshPro.HINTS.SpeechErrorTitle", "text", "Fehler")
BTC.Set("TextMeshPro.HINTS.SpeechErrorText", "text", "Es besteht ein Problem mit der Internetverbindung.\nBringe das VR Headset bitte zu deiner Lehrperson.")
BTC.Show("GO.HINTS.SpeechErrorHint")
}
Decorator(Repeat) {
BTC.Wait(60)
}
}
}
}
}
}
Tree("20_SBB_Story_A_Picknicken_Start") {
Composite(Sequence) {
BTC.Run("MediaPlayer.VIDEOS.StartF1")
BTC.Run("MediaPlayer.VIDEOS.StartFidle2")
BTC.AddPossbileSpeechIntent("Story_A_Picknicken-Start-U-2")
BTC.StartSpeechIntentRecognition()
BTC.Show("GO.HINTS.SpeakHint")
Composite(Race) {
// -- Race 1: User sagt etwas
Composite(Sequence) {
BTC.UserStartedSpeechInput()
BTC.Hide("GO.HINTS.SpeakHint")
Composite(Selector) {
// -- Selector 1: Intent erkannt
Composite(Sequence) {
BTC.SpeechIntentRecognized()
BTC.ClearPossbileSpeechIntents()
}
// -- Selector 2: Intent nicht erkannt
Composite(Sequence) {
BTC.ClearPossbileSpeechIntents()
}
}
}
// -- Race 2: User sagt nichts
Composite(Sequence) {
BTC.Wait(5)
BTC.CompareUserSpeechInputStarted(false)
BTC.AbortSpeechEventListener()
BTC.StopSpeechIntentRecognition()
BTC.ClearPossbileSpeechIntents()
BTC.Hide("GO.HINTS.SpeakHint")
}
}
BTC.Hide("MediaPlayer.VIDEOS.StartFidle2")
Composite(Marathon) {
BTC.Run("MediaPlayer.VIDEOS.StartF3")
Composite(Sequence) {
BTC.Wait(7)
BTC.FadeOut("FadeScene.XRInteractionHandsSetup.Black")
}
}
BTC.Run("LoadScene.NEXT.22Geschaeft")
}
}