545 lines
21 KiB
Plaintext

Tree("Root") {
Composite(Sequence) {
BTC.InitializeSpeechManager()
BTC.SetSpeechRecognitionLanguage("it-IT")
BTC.SetVoiceName("it-IT-FabiolaNeural")
Composite(Race) {
Composite(Sequence) {
// Error in Speech Service: Cancel BTC Trees
BTC.SpeechErrorOccured()
BTC.SetBool("error")
}
Composite(Sequence) {
BTC.FadeIn("FadeScene.XRInteractionHandsSetup.Black")
RunTree("32_Grotto_Story_B_Grotto_Intro")
//RunTree("32_Grotto_Story_B_Grotto_Antwort_Nonna_Grotto")
}
}
Composite(Sequence) {
BTC.CompareBool("error")
// Error Handling
BTC.AbortSpeechEventListener()
BTC.StopSpeechIntentRecognition()
BTC.ClearPossbileSpeechIntents()
BTC.Show("GO.GO.SpeechButton")
BTC.Set("TextMeshPro.GO.Option1Button", "text", "Restart")
BTC.Show("GO.GO.Option1Button")
BTC.Run("NamedEventTrigger.GO.Option1Button")
BTC.Hide("GO.GO.Option1Button")
BTC.Hide("GO.GO.SpeechButton")
BTC.Show("GO.GO.Home")
BTC.Hide("GO.GO.SpeechOptions")
}
}
}
Tree("32_Grotto_Story_B_Grotto_Intro") {
Composite(Sequence) {
// Initialization
BTC.Run("StudioEventEmitter.STATIC.AmbiGarten")
BTC.Show("Depthkit.VIDEOS.Intro1StoryBGrotto")
BTC.Run("Depthkit.VIDEOS.Intro1StoryBGrotto")
BTC.Hide("Depthkit.VIDEOS.Intro1StoryBGrotto")
BTC.Show("Depthkit.VIDEOS.Intro2StoryBGrotto")
BTC.Run("Depthkit.VIDEOS.Intro2StoryBGrotto")
BTC.Hide("Depthkit.VIDEOS.Intro2StoryBGrotto")
BTC.AddPossbileSpeechIntent("Story_B_Grotto.Intro.3")
BTC.AddPossbileSpeechIntent("Story_B_Grotto.Intro.4")
BTC.StartSpeechIntentRecognition()
Composite(Race) {
// -- Race 1: User sagt etwas
Composite(Selector) {
Composite(Sequence) {
BTC.UserStartedSpeechInput()
BTC.SpeechIntentRecognized()
BTC.ClearPossbileSpeechIntents()
}
// Intent nicht erkannt
Composite(Sequence) {
BTC.ClearPossbileSpeechIntents()
}
}
// -- Race 2: User sagt nichts
Composite(Sequence) {
BTC.Wait(5)
BTC.CompareUserSpeechInputStarted(false)
BTC.StopSpeechIntentRecognition()
BTC.ClearPossbileSpeechIntents()
}
}
BTC.Show("Depthkit.VIDEOS.Intro6StoryBGrotto")
BTC.Run("Depthkit.VIDEOS.Intro6StoryBGrotto")
BTC.Hide("Depthkit.VIDEOS.Intro6StoryBGrotto")
// --- Story B Grotto - Telefonat ---
BTC.Show("Depthkit.VIDEOS.Telefonat1StoryBGr")
BTC.Run("Depthkit.VIDEOS.Telefonat1StoryBGr")
BTC.Hide("Depthkit.VIDEOS.Telefonat1StoryBGr")
BTC.Run("AudioSource.AUDIO.Telefonat2StoryBGr")
BTC.Show("Depthkit.VIDEOS.Telefonat3StoryBGr")
BTC.Run("Depthkit.VIDEOS.Telefonat3StoryBGr")
BTC.Hide("Depthkit.VIDEOS.Telefonat3StoryBGr")
BTC.Run("AudioSource.AUDIO.Telefonat4StoryBGr")
BTC.Show("Depthkit.VIDEOS.Telefonat5StoryBGr")
BTC.Run("Depthkit.VIDEOS.Telefonat5StoryBGr")
BTC.Hide("Depthkit.VIDEOS.Telefonat5StoryBGr")
BTC.Show("Depthkit.VIDEOS.IdleLoopNonnaGrott")
BTC.Run("Depthkit.VIDEOS.IdleLoopNonnaGrott")
BTC.AddPossbileSpeechIntent("Story_B_Grotto.Telefonat.6")
BTC.StartSpeechIntentRecognition()
Composite(Race) {
// -- Race 1: User sagt etwas
Composite(Selector) {
Composite(Sequence) {
BTC.UserStartedSpeechInput()
BTC.SpeechIntentRecognized()
BTC.ClearPossbileSpeechIntents()
}
// Intent nicht erkannt
Composite(Sequence) {
BTC.ClearPossbileSpeechIntents()
}
}
// -- Race 2: User sagt nichts
Composite(Sequence) {
BTC.Wait(5)
BTC.CompareUserSpeechInputStarted(false)
BTC.StopSpeechIntentRecognition()
BTC.ClearPossbileSpeechIntents()
}
}
// --- Story B Grotto - Begruessung ---
BTC.Run("AudioSource.AUDIO.BegruessungohneNam")
// --- Story B Grotto - Antwort_Reise ---
BTC.AddPossbileSpeechIntent("Story_B_Grotto.Antwort_Reise.1")
BTC.StartSpeechIntentRecognition()
Composite(Race) {
// -- Race 1: User sagt etwas
Composite(Selector) {
Composite(Sequence) {
BTC.UserStartedSpeechInput()
BTC.SpeechIntentRecognized()
BTC.ClearPossbileSpeechIntents()
}
// Intent nicht erkannt
Composite(Sequence) {
BTC.ClearPossbileSpeechIntents()
}
}
// -- Race 2: User sagt nichts
Composite(Sequence) {
BTC.Wait(5)
BTC.CompareUserSpeechInputStarted(false)
BTC.StopSpeechIntentRecognition()
BTC.ClearPossbileSpeechIntents()
}
}
BTC.Run("AudioSource.AUDIO.AntwortReise4Story")
BTC.AddPossbileSpeechIntent("Story_B_Grotto.Antwort_Reise.5")
BTC.StartSpeechIntentRecognition()
Composite(Race) {
// -- Race 1: User sagt etwas
Composite(Selector) {
Composite(Sequence) {
BTC.UserStartedSpeechInput()
BTC.SpeechIntentRecognized()
BTC.ClearPossbileSpeechIntents()
}
// Intent nicht erkannt
Composite(Sequence) {
BTC.ClearPossbileSpeechIntents()
}
}
// -- Race 2: User sagt nichts
Composite(Sequence) {
BTC.Wait(5)
BTC.CompareUserSpeechInputStarted(false)
BTC.StopSpeechIntentRecognition()
BTC.ClearPossbileSpeechIntents()
}
}
BTC.Run("AudioSource.AUDIO.AntwortReise8Story")
BTC.AddPossbileSpeechIntent("Story_B_Grotto.Antwort_Reise.9")
BTC.AddPossbileSpeechIntent("Story_B_Grotto.Antwort_Reise.11")
BTC.StartSpeechIntentRecognition()
Composite(Race) {
// -- Race 1: User sagt etwas
Composite(Sequence) {
BTC.UserStartedSpeechInput()
Composite(Selector) {
// -- Selector 1: Intent erkannt
Composite(Sequence) {
BTC.SpeechIntentRecognized()
// Intent erkannt
Composite(Race) {
Composite(Sequence) {
BTC.CompareIntentID("Story_B_Grotto.Antwort_Reise.9")
BTC.ClearPossbileSpeechIntents()
RunTree("32_Grotto_Story_B_Grotto_Antwort_Nonna_Kueche")
}
Composite(Sequence) {
BTC.CompareIntentID("Story_B_Grotto.Antwort_Reise.11")
BTC.ClearPossbileSpeechIntents()
RunTree("32_Grotto_Story_B_Grotto_Antwort_Nonna_Grotto")
}
}
}
// -- Selector 2: Intent nicht erkannt
Composite(Sequence) {
// --- Story B Grotto - Nachfrage Nonna Grotto ---
// SpeechIntentRecognized Failed: kein Intent erkannt
BTC.Run("AudioSource.AUDIO.NachfrageNonnaGrot")
BTC.StartSpeechIntentRecognition()
Composite(Race) {
Composite(Sequence) {
BTC.UserStartedSpeechInput()
BTC.SpeechIntentRecognized()
Composite(Race) {
Composite(Sequence) {
BTC.CompareIntentID("Story_B_Grotto.Antwort_Reise.9")
BTC.ClearPossbileSpeechIntents()
RunTree("32_Grotto_Story_B_Grotto_Antwort_Nonna_Kueche")
}
Composite(Sequence) {
BTC.CompareIntentID("Story_B_Grotto.Antwort_Reise.11")
BTC.ClearPossbileSpeechIntents()
RunTree("32_Grotto_Story_B_Grotto_Antwort_Nonna_Grotto")
}
}
}
Composite(Sequence) {
BTC.Wait(5)
BTC.CompareUserSpeechInputStarted(false)
BTC.AbortSpeechEventListener()
BTC.StopSpeechIntentRecognition()
BTC.ClearPossbileSpeechIntents()
BTC.CompareUserSpeechInputStarted(true)
}
}
}
// Selector 3: Fallback Button
Composite(Sequence) {
Composite(Marathon) {
BTC.Show("GO.GO.SpeechButton")
BTC.Set("TextMeshPro.GO.Option1Button", "text", "L'aiuto in cucina.")
BTC.Show("GO.GO.Option1Button")
BTC.Set("TextMeshPro.GO.Option2Button", "text", "La aspetto.")
BTC.Show("GO.GO.Option2Button")
}
Composite(Race) {
Composite(Sequence) {
// Kueche
BTC.Run("NamedEventTrigger.GO.Option1Button")
BTC.AbortEventListener("NamedEventTrigger.GO.Option2Button")
BTC.Hide("GO.GO.Option1Button")
BTC.Hide("GO.GO.Option2Button")
BTC.Hide("GO.GO.SpeechButton")
BTC.Show("GO.GO.Home")
BTC.Hide("GO.GO.SpeechOptions")
RunTree("32_Grotto_Story_B_Grotto_Antwort_Nonna_Kueche")
}
Composite(Sequence) {
// Garten
BTC.Run("NamedEventTrigger.GO.Option2Button")
BTC.AbortEventListener("NamedEventTrigger.GO.Option1Button")
BTC.Hide("GO.GO.Option1Button")
BTC.Hide("GO.GO.Option2Button")
BTC.Hide("GO.GO.SpeechButton")
BTC.Show("GO.GO.Home")
BTC.Hide("GO.GO.SpeechOptions")
RunTree("32_Grotto_Story_B_Grotto_Antwort_Nonna_Grotto")
}
}
}
}
}
// -- Race 2: User sagt nichts
Composite(Sequence) {
BTC.Wait(5)
BTC.CompareUserSpeechInputStarted(false)
BTC.AbortSpeechEventListener()
BTC.StopSpeechIntentRecognition()
BTC.ClearPossbileSpeechIntents()
// --- Bilder Bergell ---
// TODO: Bergell
//BTC.Run("LoadScene.NEXT.35Slideshow")
// Fallback Button
Composite(Sequence) {
Composite(Marathon) {
BTC.Show("GO.GO.SpeechButton")
BTC.Set("TextMeshPro.GO.Option1Button", "text", "L'aiuto in cucina.")
BTC.Show("GO.GO.Option1Button")
BTC.Set("TextMeshPro.GO.Option2Button", "text", "La aspetto.")
BTC.Show("GO.GO.Option2Button")
}
Composite(Race) {
Composite(Sequence) {
// Kueche
BTC.Run("NamedEventTrigger.GO.Option1Button")
BTC.AbortEventListener("NamedEventTrigger.GO.Option2Button")
BTC.Hide("GO.GO.Option1Button")
BTC.Hide("GO.GO.Option2Button")
BTC.Hide("GO.GO.SpeechButton")
BTC.Show("GO.GO.Home")
BTC.Hide("GO.GO.SpeechOptions")
RunTree("32_Grotto_Story_B_Grotto_Antwort_Nonna_Kueche")
}
Composite(Sequence) {
// Garten
BTC.Run("NamedEventTrigger.GO.Option2Button")
BTC.AbortEventListener("NamedEventTrigger.GO.Option1Button")
BTC.Hide("GO.GO.Option1Button")
BTC.Hide("GO.GO.Option2Button")
BTC.Hide("GO.GO.SpeechButton")
BTC.Show("GO.GO.Home")
BTC.Hide("GO.GO.SpeechOptions")
RunTree("32_Grotto_Story_B_Grotto_Antwort_Nonna_Grotto")
}
}
}
}
}
}
}
Tree("32_Grotto_Story_B_Grotto_Antwort_Nonna_Kueche") {
// --- Story B Grotto - Antwort Nonna Kueche ---
Composite(Sequence) {
BTC.Run("AudioSource.AUDIO.AntwortNonnaKueche")
BTC.AddPossbileSpeechIntent("Story_B_Grotto.Antwort_Nonna_Kueche.2")
BTC.StartSpeechIntentRecognition()
Composite(Race) {
// -- Race 1: User sagt etwas
Composite(Selector) {
Composite(Sequence) {
BTC.UserStartedSpeechInput()
BTC.SpeechIntentRecognized()
BTC.ClearPossbileSpeechIntents()
}
// Intent nicht erkannt
Composite(Sequence) {
BTC.ClearPossbileSpeechIntents()
}
}
// -- Race 2: User sagt nichts
Composite(Sequence) {
BTC.Wait(5)
BTC.CompareUserSpeechInputStarted(false)
BTC.StopSpeechIntentRecognition()
BTC.ClearPossbileSpeechIntents()
}
}
// --- Story B Grotto - Outro ---
BTC.Run("AudioSource.AUDIO.Outro1StoryBGrotto")
BTC.Hide("Depthkit.VIDEOS.IdleLoopNonnaGrott")
BTC.Show("Depthkit.VIDEOS.Outro2StoryBGrotto")
BTC.Run("Depthkit.VIDEOS.Outro2StoryBGrotto")
BTC.Hide("Depthkit.VIDEOS.Outro2StoryBGrotto")
BTC.AddPossbileSpeechIntent("Story_B_Grotto.Outro.3")
BTC.StartSpeechIntentRecognition()
Composite(Race) {
// -- Race 1: User sagt etwas
Composite(Selector) {
Composite(Sequence) {
BTC.UserStartedSpeechInput()
BTC.SpeechIntentRecognized()
BTC.ClearPossbileSpeechIntents()
}
// Intent nicht erkannt
Composite(Sequence) {
BTC.ClearPossbileSpeechIntents()
}
}
// -- Race 2: User sagt nichts
Composite(Sequence) {
BTC.Wait(5)
BTC.CompareUserSpeechInputStarted(false)
BTC.StopSpeechIntentRecognition()
BTC.ClearPossbileSpeechIntents()
}
}
BTC.FadeOut("FadeScene.XRInteractionHandsSetup.Black")
BTC.Run("LoadScene.NEXT.32Grotto2") // Go to Grotto2 Kueche
}
}
Tree("32_Grotto_Story_B_Grotto_Antwort_Nonna_Grotto") {
// --- Story B Grotto - Antwort Nonna Grotto ---
Composite(Sequence) {
BTC.Run("AudioSource.AUDIO.AntwortNonnaGrotto_01")
BTC.AddPossbileSpeechIntent("Story_B_Grotto.Antwort_Nonna_Grotto.2")
BTC.StartSpeechIntentRecognition()
Composite(Race) {
// -- Race 1: User sagt etwas
Composite(Selector) {
Composite(Sequence) {
BTC.UserStartedSpeechInput()
BTC.SpeechIntentRecognized()
BTC.ClearPossbileSpeechIntents()
}
// 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.Run("AudioSource.AUDIO.AntwortNonnaGrotto_05")
BTC.AddPossbileSpeechIntent("Story_B_Grotto.Antwort_Nonna_Grotto.6")
BTC.StartSpeechIntentRecognition()
Composite(Race) {
// -- Race 1: User sagt etwas
Composite(Selector) {
Composite(Sequence) {
BTC.UserStartedSpeechInput()
BTC.SpeechIntentRecognized()
BTC.ClearPossbileSpeechIntents()
}
// 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("Depthkit.VIDEOS.IdleLoopNonnaGrott")
//BTC.SynthesizeText("Mentre aspetti, se vuoi puoi dare un'occhiata alle foto che ho scattato di recente in Bregaglia. Puoi usare il visore che trovi sul tavolo.")
//BTC.SpeechOutputEnded()
// TODO: Option VR Brille Bilder und Buch anschauen fehlt
BTC.FadeOut("FadeScene.XRInteractionHandsSetup.Black")
// Initialization
Composite(Marathon) {
BTC.SetPosition("GO.XRInteractionHandsSetup.XROrigin", -4.648, 0, -12.295)
BTC.SetPosition("GO.HANDMENU", -4.648, 0, -12.295)
BTC.RotateToAngle("GO.XRInteractionHandsSetup.XROrigin", 0.0)
BTC.RotateToAngle("GO.HANDMENU", 0.0)
BTC.Run("StudioEventEmitter.STATIC.KuechenAmbi")
BTC.Run("StudioEventEmitter.STATIC.AmbiGarten")
BTC.FadeIn("FadeScene.XRInteractionHandsSetup.Black")
}
BTC.Wait(5)
BTC.Show("Depthkit.VIDEOS.AntwortNonnaGrotto_10")
BTC.Run("Depthkit.VIDEOS.AntwortNonnaGrotto_10")
BTC.Hide("Depthkit.VIDEOS.AntwortNonnaGrotto_10")
BTC.AddPossbileSpeechIntent("Story_B_Grotto.Antwort_Nonna_Grotto.11")
BTC.AddPossbileSpeechIntent("Story_B_Grotto.Antwort_Nonna_Grotto.12")
BTC.StartSpeechIntentRecognition()
Composite(Race) {
// -- Race 1: User sagt etwas
Composite(Selector) {
Composite(Sequence) {
BTC.UserStartedSpeechInput()
BTC.SpeechIntentRecognized()
BTC.ClearPossbileSpeechIntents()
}
// Intent nicht erkannt
Composite(Sequence) {
BTC.ClearPossbileSpeechIntents()
}
}
// -- Race 2: User sagt nichts
Composite(Sequence) {
BTC.Wait(5)
BTC.CompareUserSpeechInputStarted(false)
BTC.StopSpeechIntentRecognition()
BTC.ClearPossbileSpeechIntents()
}
}
BTC.Show("Depthkit.VIDEOS.AntwortNonnaGrotto_15")
BTC.Run("Depthkit.VIDEOS.AntwortNonnaGrotto_15")
BTC.Hide("Depthkit.VIDEOS.AntwortNonnaGrotto_15")
BTC.FadeOut("FadeScene.XRInteractionHandsSetup.Black")
BTC.Run("LoadScene.NEXT.32Grotto3") // Go to Grotto3 Essen
}
}