Tree("Root") { Composite(Sequence) { // RunTree("32_Grotto_Kueche_Intro") 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) { RunTree("32_Grotto_Kueche_Intro") //RunTree("32_Grotto_Kueche_Zwiebeln_schneiden") //RunTree("32_Grotto_Kueche_alles_gefunden") //RunTree("32_Grotto_Kueche_Interesse_Kochen") //RunTree("32_Grotto_Kueche_Kochen_Anzahl") //RunTree("32_Grotto_Kueche_Zusammen_Kochen") //RunTree("32_Grotto_Kueche_Parmigiano") } } 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.Hide("GO.GO.SpeechOptions") } } } Tree("32_Grotto_Kueche_Intro") { // --- Kueche - Intro --- Composite(Sequence) { BTC.Run("MediaPlayer.VIDEOS.KuecheIntroFidle1") BTC.FadeIn("FadeScene.XRInteractionHandsSetup.Black") BTC.Hide("MediaPlayer.VIDEOS.KuecheIntroFidle1") BTC.Run("MediaPlayer.VIDEOS.KuecheIntroF2") BTC.Run("MediaPlayer.VIDEOS.KuecheIntroFidle3") BTC.Wait(5) BTC.Hide("MediaPlayer.VIDEOS.KuecheIntroFidle3") BTC.Run("MediaPlayer.VIDEOS.KuecheIntroF4") BTC.Run("MediaPlayer.VIDEOS.KuecheIntroFidle5") BTC.AddPossbileSpeechIntent("Kueche.Intro.3") // TODO: Update SPeech Intent BTC.StartSpeechIntentRecognition() Composite(Race) { // -- Race 1: User sagt etwas Composite(Selector) { Composite(Sequence) { BTC.UserStartedSpeechInput() BTC.SpeechIntentRecognized() BTC.ClearPossbileSpeechIntents() BTC.Hide("MediaPlayer.VIDEOS.KuecheIntroFidle5") } // Intent nicht erkannt Composite(Sequence) { Decorator(Inverter) { BTC.CompareUserSpeechInputStarted(false) } BTC.ClearPossbileSpeechIntents() BTC.Hide("MediaPlayer.VIDEOS.KuecheIntroFidle5") } } // -- Race 2: User sagt nichts Composite(Sequence) { BTC.Wait(5) BTC.CompareUserSpeechInputStarted(false) BTC.AbortSpeechEventListener() BTC.StopSpeechIntentRecognition() // --- Kueche - Nachfrage Rezept --- BTC.Hide("MediaPlayer.VIDEOS.KuecheIntroFidle5") BTC.Run("MediaPlayer.VIDEOS.NachfrageRezeptF1") BTC.Run("MediaPlayer.VIDEOS.NachfrageRezeptFid_02") BTC.StartSpeechIntentRecognition() Composite(Race) { // -- Race 1: User sagt etwas Composite(Selector) { Composite(Sequence) { BTC.UserStartedSpeechInput() BTC.SpeechIntentRecognized() BTC.ClearPossbileSpeechIntents() BTC.Hide("MediaPlayer.VIDEOS.NachfrageRezeptFid_02") } // Intent nicht erkannt Composite(Sequence) { BTC.ClearPossbileSpeechIntents() BTC.Hide("MediaPlayer.VIDEOS.NachfrageRezeptFid_02") } } // -- Race 2: User sagt nichts Composite(Sequence) { BTC.Wait(5) BTC.CompareUserSpeechInputStarted(false) BTC.AbortSpeechEventListener() BTC.StopSpeechIntentRecognition() BTC.ClearPossbileSpeechIntents() BTC.Hide("MediaPlayer.VIDEOS.NachfrageRezeptFid_02") BTC.Run("MediaPlayer.VIDEOS.NachfrageRezeptF3") } } } } // --- Kueche - Zwiebeln schneiden --- BTC.Run("MediaPlayer.VIDEOS.ZwiebelnschneidenF_01") BTC.Run("MediaPlayer.VIDEOS.ZwiebelnschneidenF_Idle02") Composite(Race) { Composite(Sequence) { BTC.Wait(30) BTC.SetBool("CancelCooking") } Composite(Sequence) { // Zwiebeln schneiden BTC.FindObjectsByTag("SlicedZwiebel", 6) BTC.SetBool("CancelCooking", false) BTC.Show("GO.STATIC.RezeptCheckmark2") } } Composite(Selector) { BTC.CompareBool("CancelCooking", false) Composite(Sequence) { // --- Kueche - Abbruch --- BTC.Hide("MediaPlayer.VIDEOS.ZwiebelnschneidenF_Idle02") BTC.Run("MediaPlayer.VIDEOS.AbbruchF1") // TODO: Define Jump Point to grotto 1 BTC.Run("LoadScene.NEXT.32Grotto1") } } // --- Kueche - alles gefunden --- BTC.Hide("MediaPlayer.VIDEOS.ZwiebelnschneidenF_Idle02") BTC.Run("MediaPlayer.VIDEOS.allesgefundenF1") BTC.Run("MediaPlayer.VIDEOS.allesgefundenFidle_02") // Oel in Topf geben BTC.Run("Particle.INTERACTABLES.Olivenoel") BTC.Show("GO.STATIC.RezeptCheckmark3") BTC.Hide("MediaPlayer.VIDEOS.allesgefundenFidle_02") BTC.Run("MediaPlayer.VIDEOS.allesgefundenF3") BTC.Run("MediaPlayer.VIDEOS.allesgefundenFidle_04") // Herd anstellen - ToDo: Handling in Story? //BTC.Run("NamedGrabEvent.STATIC.Herdschalter") //BTC.Run("StudioEventEmitter.STATIC.HerdplatteAnstelle") // Zwiebeln in Topf geben BTC.Set("Collider.INTERACTABLES.Topf", "otherTag", "SlicedZwiebel") BTC.Run("Collider.INTERACTABLES.Topf") BTC.Run("StudioEventEmitter.INTERACTABLES.ZwiebelnInTopf") BTC.Show("GO.STATIC.RezeptCheckmark4") BTC.Hide("MediaPlayer.VIDEOS.allesgefundenFidle_04") BTC.Run("MediaPlayer.VIDEOS.allesgefundenF5") BTC.Run("MediaPlayer.VIDEOS.allesgefundenFidle_06") // Frage beantworten BTC.AddPossbileSpeechIntent("Kueche.alles_gefunden.4") BTC.AddPossbileSpeechIntent("Kueche.alles_gefunden.6") 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("Kueche.alles_gefunden.4") BTC.ClearPossbileSpeechIntents() RunTree("32_Grotto_Kueche_Interesse_Kochen") } Composite(Sequence) { BTC.CompareIntentID("Kueche.alles_gefunden.6") BTC.ClearPossbileSpeechIntents() RunTree("32_Grotto_Kueche_Zusammen_Kochen") } } } // -- Selector 2: Intent nicht erkannt Composite(Sequence) { BTC.ClearPossbileSpeechIntents() // Fallback Button Composite(Marathon) { BTC.Show("GO.GO.SpeechButton") BTC.Set("TextMeshPro.GO.Option1Button", "text", "Sì.") BTC.Show("GO.GO.Option1Button") BTC.Set("TextMeshPro.GO.Option2Button", "text", "No.") BTC.Show("GO.GO.Option2Button") } Composite(Race) { Composite(Sequence) { // Ja 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.Hide("GO.GO.SpeechOptions") RunTree("32_Grotto_Kueche_Interesse_Kochen") } Composite(Sequence) { // Nein 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.Hide("GO.GO.SpeechOptions") RunTree("32_Grotto_Kueche_Zusammen_Kochen") } } } } } // -- Race 2: User sagt nichts Composite(Sequence) { BTC.Wait(5) BTC.CompareUserSpeechInputStarted(false) BTC.AbortSpeechEventListener() BTC.StopSpeechIntentRecognition() BTC.ClearPossbileSpeechIntents() // Fallback Button Composite(Marathon) { BTC.Show("GO.GO.SpeechButton") BTC.Set("TextMeshPro.GO.Option1Button", "text", "Sì.") BTC.Show("GO.GO.Option1Button") BTC.Set("TextMeshPro.GO.Option2Button", "text", "No.") BTC.Show("GO.GO.Option2Button") } Composite(Race) { Composite(Sequence) { // Ja 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.Hide("GO.GO.SpeechOptions") RunTree("32_Grotto_Kueche_Interesse_Kochen") } Composite(Sequence) { // Nein 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.Hide("GO.GO.SpeechOptions") RunTree("32_Grotto_Kueche_Zusammen_Kochen") } } } } } } Tree("32_Grotto_Kueche_Interesse_Kochen") { // --- Kueche - Interesse Kochen --- Composite(Sequence) { BTC.Hide("MediaPlayer.VIDEOS.allesgefundenFidle_06") BTC.Run("MediaPlayer.VIDEOS.InteresseKochenF1") BTC.Run("MediaPlayer.VIDEOS.InteresseKochenFid_02") // Frage beantworten BTC.AddPossbileSpeechIntent("Kueche.Interesse_Kochen.2") 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 BTC.ClearPossbileSpeechIntents() RunTree("32_Grotto_Kueche_Kochen_Anzahl") } // -- Selector 2: Intent nicht erkannt Composite(Sequence) { BTC.ClearPossbileSpeechIntents() RunTree("32_Grotto_Kueche_Kochen_Anzahl") } } } // -- Race 2: User sagt nichts Composite(Sequence) { BTC.Wait(5) BTC.CompareUserSpeechInputStarted(false) BTC.AbortSpeechEventListener() BTC.StopSpeechIntentRecognition() BTC.ClearPossbileSpeechIntents() RunTree("32_Grotto_Kueche_Zusammen_Kochen") } } } } Tree("32_Grotto_Kueche_Kochen_Anzahl") { // --- Kueche - Kochen Anzahl --- Composite(Sequence) { BTC.Hide("MediaPlayer.VIDEOS.InteresseKochenFid_02") BTC.Run("MediaPlayer.VIDEOS.KochenAnzahlF1") BTC.Run("MediaPlayer.VIDEOS.KochenAnzahlFidle2") // Frage beantworten BTC.AddPossbileSpeechIntent("Kueche.Kochen_Anzahl.2") BTC.AddPossbileSpeechIntent("Kueche.Kochen_Anzahl.4") 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 RunTree("32_Grotto_Kueche_Zusammen_Kochen") } // -- Selector 2: Intent nicht erkannt Composite(Sequence) { BTC.ClearPossbileSpeechIntents() // Fallback Button Composite(Marathon) { BTC.Show("GO.GO.SpeechButton") BTC.Set("TextMeshPro.GO.Option1Button", "text", "molto spesso") BTC.Show("GO.GO.Option1Button") BTC.Set("TextMeshPro.GO.Option2Button", "text", "raramente") BTC.Show("GO.GO.Option2Button") } Composite(Race) { Composite(Sequence) { // sehr oft 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.Hide("GO.GO.SpeechOptions") RunTree("32_Grotto_Kueche_Zusammen_Kochen") } Composite(Sequence) { // selten 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.Hide("GO.GO.SpeechOptions") RunTree("32_Grotto_Kueche_Zusammen_Kochen") } } } } } // -- Race 2: User sagt nichts Composite(Sequence) { BTC.Wait(5) BTC.CompareUserSpeechInputStarted(false) BTC.AbortSpeechEventListener() BTC.StopSpeechIntentRecognition() BTC.ClearPossbileSpeechIntents() RunTree("32_Grotto_Kueche_Zusammen_Kochen") } } } } Tree("32_Grotto_Kueche_Zusammen_Kochen") { // --- Kueche - Zusammen Kochen --- Composite(Sequence) { Composite(Marathon) { BTC.Hide("MediaPlayer.VIDEOS.allesgefundenFidle_06") BTC.Hide("MediaPlayer.VIDEOS.InteresseKochenFid_02") BTC.Hide("MediaPlayer.VIDEOS.KochenAnzahlFidle2") } BTC.Run("MediaPlayer.VIDEOS.ZusammenKochenF1") BTC.Run("MediaPlayer.VIDEOS.ZusammenKochenFidl_02") // Reis in Topf geben BTC.Run("GO/Particle.INTERACTABLES.Risotto") BTC.Show("GO.STATIC.RezeptCheckmark5") // Ruehren BTC.Set("Collider.INTERACTABLES.Topf", "otherTag", "Loeffel") BTC.Run("Collider.INTERACTABLES.Topf") BTC.Wait(2) BTC.Hide("MediaPlayer.VIDEOS.ZusammenKochenFidl_02") BTC.Run("MediaPlayer.VIDEOS.ZusammenKochenF3") BTC.Run("MediaPlayer.VIDEOS.ZusammenKochenFidl_04") // Wein in Topf giessen BTC.Run("Particle.INTERACTABLES.Weisswein") BTC.StopSound("StudioEventEmitter.INTERACTABLES.ZwiebelnInTopf") BTC.Run("StudioEventEmitter.INTERACTABLES.Abloeschen") BTC.Show("GO.STATIC.RezeptCheckmark6") Composite(Marathon) { Composite(Sequence) { BTC.Wait(16) BTC.SetFloat("StudioEventEmitter.INTERACTABLES.Abloeschen", "blubbern.transition", 1) BTC.Show("GO.INTERACTABLES.ChangeSound") // Ruehren } Composite(Sequence) { BTC.Wait(5) BTC.Hide("MediaPlayer.VIDEOS.ZusammenKochenFidl_04") BTC.Run("MediaPlayer.VIDEOS.ZusammenKochenF5") BTC.Run("MediaPlayer.VIDEOS.ZusammenKochenFidl_06") } } // Bouillon in Topf geben BTC.Run("Particle.INTERACTABLES.Bouillon") BTC.Show("GO.STATIC.RezeptCheckmark7") BTC.Hide("MediaPlayer.VIDEOS.ZusammenKochenFidl_06") BTC.Run("MediaPlayer.VIDEOS.ZusammenKochenF7") BTC.Run("MediaPlayer.VIDEOS.ZusammenKochenFidl_08") // Glas Wasser mit Steinpilze in Topf geben BTC.Set("Collider.INTERACTABLES.Topf", "otherTag", "Steinpilze") BTC.Run("Collider.INTERACTABLES.Topf") BTC.Show("GO.STATIC.RezeptCheckmark8") BTC.Wait(5) BTC.Hide("MediaPlayer.VIDEOS.ZusammenKochenFidl_08") BTC.Run("MediaPlayer.VIDEOS.ZusammenKochenF9") BTC.Run("MediaPlayer.VIDEOS.ZusammenKochenFidl_10") // Parmigiano in Topf geben BTC.Run("Particle.INTERACTABLES.Parmesan") BTC.Show("GO.STATIC.RezeptCheckmark9") BTC.Hide("MediaPlayer.VIDEOS.ZusammenKochenFidl_10") BTC.Run("MediaPlayer.VIDEOS.ZusammenKochenF11") // --- Kueche - Outro --- BTC.Run("MediaPlayer.VIDEOS.OutroF1") BTC.Run("MediaPlayer.VIDEOS.OutroFidle8") Composite(Marathon) { Composite(Sequence) { BTC.Run("MediaPlayer.VIDEOS.OutroG3") BTC.Run("MediaPlayer.VIDEOS.OutroGidle6") } Composite(Sequence) { BTC.Wait(12) BTC.Hide("MediaPlayer.VIDEOS.OutroFidle8") BTC.Run("MediaPlayer.VIDEOS.OutroF4") BTC.Run("MediaPlayer.VIDEOS.OutroFidle5") } } // Name sagen BTC.AddPossbileSpeechIntent("Kueche.Outro.4") BTC.StartSpeechIntentRecognition() Composite(Race) { // -- Race 1: User sagt etwas Composite(Sequence) { BTC.UserStartedSpeechInput() 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() } } Composite(Marathon) { Composite(Sequence) { BTC.Hide("MediaPlayer.VIDEOS.OutroGidle6") BTC.Run("MediaPlayer.VIDEOS.OutroG9") BTC.Run("MediaPlayer.VIDEOS.OutroGidle10") } Composite(Sequence) { BTC.Wait(1) BTC.Hide("MediaPlayer.VIDEOS.OutroFidle5") BTC.Run("MediaPlayer.VIDEOS.OutroF7") BTC.Run("MediaPlayer.VIDEOS.OutroFidle8") } } Composite(Marathon) { Composite(Sequence) { BTC.Hide("MediaPlayer.VIDEOS.OutroFidle8") BTC.Run("MediaPlayer.VIDEOS.OutroF11") BTC.Run("MediaPlayer.VIDEOS.OutroFidle14") } Composite(Sequence) { BTC.Wait(1) BTC.Hide("MediaPlayer.VIDEOS.OutroGidle10") BTC.Run("MediaPlayer.VIDEOS.OutroG12") BTC.Run("MediaPlayer.VIDEOS.OutroGidle13") } } BTC.AddPossbileSpeechIntent("Story_B_Grotto.Intro.3") // TODO: Update Speech Intent BTC.AddPossbileSpeechIntent("Story_B_Grotto.Intro.4") // TODO: Update Speech Intent 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.Intro.3") BTC.ClearPossbileSpeechIntents() BTC.FadeOut("FadeScene.XRInteractionHandsSetup.Black") BTC.Run("LoadScene.NEXT.32Grotto3") } Composite(Sequence) { BTC.CompareIntentID("Story_B_Grotto.Intro.4") 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("MediaPlayer.VIDEOS.OutroFidle14") Composite(Marathon) { BTC.Run("MediaPlayer.VIDEOS.OutroF15") Composite(Sequence) { BTC.Wait(7) BTC.FadeOut("FadeScene.XRInteractionHandsSetup.Black") } } BTC.Run("LoadScene.NEXT.32Grotto3") } }