UP-Viagg-io/Viagg-io/Assets/BehaviourTrees/3.2-Grotto.bt.txt

768 lines
31 KiB
Plaintext
Raw Normal View History

2024-06-05 16:23:48 +02:00
Tree("Root") {
2024-07-19 19:56:36 +02:00
Composite(Sequence) {
2024-09-19 17:27:15 +02:00
BTC.InitializeSpeechManager()
2024-09-24 17:33:08 +02:00
RunTree("32_Grotto_Kueche_Intro")
RunTree("32_Grotto_Kueche_Zwiebeln_schneiden")
2024-09-19 17:27:15 +02:00
RunTree("32_Grotto_Kueche_alles_gefunden")
//RunTree("32_Grotto_Kueche_Kochen_Anzahl")
//RunTree("32_Grotto_Kueche_Zusammen_Kochen")
2024-09-19 17:27:15 +02:00
//RunTree("32_Grotto_Story_B_Grotto")
}
}
2024-09-19 17:27:15 +02:00
Tree("32_Grotto_Story_B_Grotto") {
// --- Story B Grotto - Antwort Reise ---
Composite(Sequence) {
BTC.SynthesizeText("Ich möchte nirgends sonst auf der Welt leben. Möchtest du denn mit Francesca in der Küche etwas aushelfen oder wartest du im Garten auf sie?", "de-DE", "")
2024-09-17 17:10:28 +02:00
BTC.SpeechOutputEnded()
//BTC.SetSpeechRecognitionLanguage("it-IT")
//BTC.AddPossbileSpeechIntent("Story_B_Grotto.Nachfrage_Nonna_Grotto.2", "Laiuto in cucina.")
//BTC.AddPossbileSpeechIntent("Story_B_Grotto.Nachfrage_Nonna_Grotto.4", "Preferisco aspettarla nella sala del grotto. Non so cucinare.")
BTC.AddPossbileSpeechIntent("Story_B_Grotto.Nachfrage_Nonna_Grotto.2", "Ich helfe in der Küche.")
BTC.AddPossbileSpeechIntent("Story_B_Grotto.Nachfrage_Nonna_Grotto.4", "Ich warte im Garten auf sie.")
BTC.StartSpeechIntentRecognition()
Composite(Race) {
2024-09-19 17:27:15 +02:00
// -- Race 1: User sagt etwas
Composite(Sequence) {
BTC.UserStartedSpeechInput()
2024-09-19 17:27:15 +02:00
Composite(Selector) {
// -- Selector 1: Intent erkannt
Composite(Sequence) {
2024-09-19 17:27:15 +02:00
BTC.SpeechIntentRecognized()
// Intent erkannt
Composite(Race) {
Composite(Sequence) {
BTC.CompareIntentID("Story_B_Grotto.Nachfrage_Nonna_Grotto.2")
BTC.ClearPossbileSpeechIntents()
RunTree("32_Grotto_Story_B_Grotto_Antwort_Nonna_Kueche")
}
Composite(Sequence) {
BTC.CompareIntentID("Story_B_Grotto.Nachfrage_Nonna_Grotto.4")
BTC.ClearPossbileSpeechIntents()
RunTree("32_Grotto_Story_B_Grotto_Antwort_Nonna_Grotto")
}
}
}
2024-09-19 17:27:15 +02:00
// -- Selector 2: Intent nicht erkannt
Composite(Sequence) {
// --- Story B Grotto - Nachfrage Nonna Grotto ---
// SpeechIntentRecognized Failed: kein Intent erkannt
BTC.SynthesizeText("Was wolltest du sagen? Ich habe es nicht verstanden. Möchtest du mithelfen oder lieber im Garten warten?", "de-DE", "")
BTC.SpeechOutputEnded()
2024-09-17 17:10:28 +02:00
2024-09-19 17:27:15 +02:00
BTC.StartSpeechIntentRecognition()
// Fallback fehlt, wenn nichts gesagt wird
BTC.UserStartedSpeechInput()
BTC.SpeechIntentRecognized()
2024-09-19 17:27:15 +02:00
Composite(Race) {
Composite(Sequence) {
BTC.CompareIntentID("Story_B_Grotto.Nachfrage_Nonna_Grotto.2")
BTC.ClearPossbileSpeechIntents()
RunTree("32_Grotto_Story_B_Grotto_Antwort_Nonna_Kueche")
}
Composite(Sequence) {
BTC.CompareIntentID("Story_B_Grotto.Nachfrage_Nonna_Grotto.4")
BTC.ClearPossbileSpeechIntents()
RunTree("32_Grotto_Story_B_Grotto_Antwort_Nonna_Grotto")
}
}
}
2024-09-19 17:27:15 +02:00
// Fallback 2mal nicht verstanden: Button klick
}
}
2024-09-19 17:27:15 +02:00
// -- Race 2: User sagt nichts
Composite(Sequence) {
BTC.Wait(5)
BTC.CompareUserSpeechInputStarted(false)
BTC.AbortSpeechEventListener()
2024-09-19 17:27:15 +02:00
BTC.StopSpeechIntentRecognition()
BTC.ClearPossbileSpeechIntents()
2024-09-19 17:27:15 +02:00
// --- Bilder Bergell ---
//BTC.Run("LoadScene.NEXT.35Slideshow")
}
}
}
}
2024-09-19 17:27:15 +02:00
Tree("32_Grotto_Story_B_Grotto_Antwort_Nonna_Kueche") {
// --- Story B Grotto - Antwort Nonna Kueche ---
2024-09-17 17:10:28 +02:00
Composite(Sequence) {
BTC.SynthesizeText("Oh, das ist wunderbar, vielen Dank! Anschliessend seid ihr selbstverständlich zum Essen eingeladen.", "de-DE", "")
2024-09-17 17:10:28 +02:00
BTC.SpeechOutputEnded()
//BTC.AddPossbileSpeechIntent("Story_B_Grotto.Antwort_Nonna_Kueche.2", "Tante grazie, è molto gentile da parte Sua (o altra risposta).")
2024-09-17 17:10:28 +02:00
BTC.AddPossbileSpeechIntent("Story_B_Grotto.Antwort_Nonna_Kueche.2", "Vielen Dank, das ist nett (oder andere Antwort)")
BTC.StartSpeechIntentRecognition()
Composite(Race) {
2024-09-19 17:27:15 +02:00
// -- Race 1: User sagt etwas
2024-09-17 17:10:28 +02:00
Composite(Selector) {
Composite(Sequence) {
BTC.UserStartedSpeechInput()
BTC.SpeechIntentRecognized()
BTC.ClearPossbileSpeechIntents()
}
// Intent nicht erkannt
Composite(Sequence) {
BTC.ClearPossbileSpeechIntents()
}
}
2024-09-19 17:27:15 +02:00
// -- Race 2: User sagt nichts
2024-09-17 17:10:28 +02:00
Composite(Sequence) {
BTC.Wait(5)
BTC.CompareUserSpeechInputStarted(false)
BTC.StopSpeechIntentRecognition()
BTC.ClearPossbileSpeechIntents()
}
}
2024-09-19 17:27:15 +02:00
// --- Story B Grotto - Outro ---
// ...
2024-09-17 17:10:28 +02:00
}
}
2024-09-19 17:27:15 +02:00
Tree("32_Grotto_Story_B_Grotto_Antwort_Nonna_Grotto") {
// --- Story B Grotto - Antwort Nonna Grotto ---
2024-09-17 17:10:28 +02:00
Composite(Sequence) {
BTC.SynthesizeText("Okay gut, mach es dir gemütlich. Hast du etwas zum Lesen dabei?", "de-DE", "")
2024-09-17 17:10:28 +02:00
BTC.SpeechOutputEnded()
//BTC.AddPossbileSpeechIntent("Story_B_Grotto.Antwort_Nonna_Grotto.2", "Sì, grazie, ho qualcosa con me (o un'altra risposta)")
2024-09-17 17:10:28 +02:00
BTC.AddPossbileSpeechIntent("Story_B_Grotto.Antwort_Nonna_Grotto.2", "Ja, danke, ich habe etwas dabei (oder andere Antwort)")
BTC.StartSpeechIntentRecognition()
Composite(Race) {
2024-09-19 17:27:15 +02:00
// -- Race 1: User sagt etwas
2024-09-17 17:10:28 +02:00
Composite(Selector) {
Composite(Sequence) {
BTC.UserStartedSpeechInput()
BTC.SpeechIntentRecognized()
2024-09-19 17:27:15 +02:00
BTC.ClearPossbileSpeechIntents()
2024-09-17 17:10:28 +02:00
}
// Intent nicht erkannt
Composite(Sequence) {
2024-09-19 17:27:15 +02:00
BTC.ClearPossbileSpeechIntents()
2024-09-17 17:10:28 +02:00
}
}
2024-09-19 17:27:15 +02:00
// -- Race 2: User sagt nichts
2024-09-17 17:10:28 +02:00
Composite(Sequence) {
BTC.Wait(5)
BTC.CompareUserSpeechInputStarted(false)
BTC.StopSpeechIntentRecognition()
2024-09-19 17:27:15 +02:00
BTC.ClearPossbileSpeechIntents()
2024-09-17 17:10:28 +02:00
}
}
BTC.SynthesizeText("Prima, viel Spass noch und dann guten Appetit!", "de-DE", "")
2024-09-17 17:10:28 +02:00
BTC.SpeechOutputEnded()
//BTC.AddPossbileSpeechIntent("Story_B_Grotto.Antwort_Nonna_Grotto.6", "Grazie nonna, ciao!")
2024-09-17 17:10:28 +02:00
BTC.AddPossbileSpeechIntent("Story_B_Grotto.Antwort_Nonna_Grotto.6", "Danke!")
BTC.StartSpeechIntentRecognition()
Composite(Race) {
2024-09-19 17:27:15 +02:00
// -- Race 1: User sagt etwas
2024-09-17 17:10:28 +02:00
Composite(Selector) {
Composite(Sequence) {
BTC.UserStartedSpeechInput()
BTC.SpeechIntentRecognized()
BTC.ClearPossbileSpeechIntents()
//BTC.GetKeyDown("Return")
2024-09-17 17:10:28 +02:00
}
// Intent nicht erkannt
Composite(Sequence) {
BTC.ClearPossbileSpeechIntents()
//BTC.GetKeyDown("Return")
2024-09-17 17:10:28 +02:00
}
}
2024-09-19 17:27:15 +02:00
// -- Race 2: User sagt nichts
2024-09-17 17:10:28 +02:00
Composite(Sequence) {
BTC.Wait(5)
BTC.CompareUserSpeechInputStarted(false)
BTC.StopSpeechIntentRecognition()
BTC.ClearPossbileSpeechIntents()
}
}
}
}
2024-07-17 10:56:22 +02:00
Tree("32_Grotto_Kueche_Intro") {
2024-09-19 17:27:15 +02:00
// --- Kueche - Intro ---
2024-07-17 10:56:22 +02:00
Composite(Sequence) {
2024-07-19 19:56:36 +02:00
BTC.Run("AudioSource.AUDIO.Kueche1FIntro")
// Schuerze greifen
//BTC.GetKeyDown("Return")
2024-08-02 16:38:48 +02:00
BTC.Run("GO/NamedGrabEvent.INTERACTABLES.Schuerze")
BTC.Hide("GO/NamedGrabEvent.INTERACTABLES.Schuerze")
2024-09-24 17:33:08 +02:00
//BTC.Run("AudioSource.AUDIO.Kueche2FIntro")
BTC.SynthesizeText("Lies mir bitte das Rezept vor.", "de-DE", "")
BTC.SpeechOutputEnded()
2024-07-19 19:56:36 +02:00
2024-07-24 17:17:14 +02:00
// Rezept vorlesen: Button Klick
2024-07-17 10:56:22 +02:00
BTC.Set("TextMeshPro.HANDMENU.Option1Button", "text", "Rezept vorlesen")
2024-07-19 19:56:36 +02:00
BTC.Show("GO.HANDMENU.Option1Button")
2024-08-15 17:23:58 +02:00
Composite(Race) {
Composite(Sequence) {
// auf Button klicken
BTC.Run("NamedEventTrigger.HANDMENU.Option1Button")
//BTC.GetKeyDown("Return")
2024-08-15 17:23:58 +02:00
}
Composite(Sequence) {
// keine Reaktion
BTC.Wait(5)
2024-09-24 17:33:08 +02:00
BTC.SynthesizeText("Was brauchen wir? Bitte lies mir das Rezept vor.", "de-DE", "")
BTC.SpeechOutputEnded()
2024-08-15 17:23:58 +02:00
BTC.Run("NamedEventTrigger.HANDMENU.Option1Button")
}
}
2024-07-19 19:56:36 +02:00
BTC.Hide("GO.HANDMENU.Option1Button")
2024-08-15 17:23:58 +02:00
2024-07-19 19:56:36 +02:00
BTC.Run("AudioSource.AUDIO.Kueche3FIntro")
// Pilze leuchten
BTC.Enable("NamedGrabEvent/NamedOutline.INTERACTABLES.Steinpilze")
Composite(Race) {
Composite(Sequence) {
2024-07-19 19:56:36 +02:00
// Pilze ins Wasser Glas legen
BTC.Run("NamedGrabEvent/NamedOutline.INTERACTABLES.Steinpilze")
BTC.Set("Collider.INTERACTABLES.GlassWasserTrigger", "otherTag", "Steinpilze")
BTC.Run("Collider.INTERACTABLES.GlassWasserTrigger")
}
Composite(Sequence) {
// Keine Reaction
2024-07-19 19:56:36 +02:00
BTC.Wait(5)
2024-09-19 17:27:15 +02:00
// --- Kueche - Steinpilze Hilfe ---
BTC.Run("AudioSource.AUDIO.Kueche1FSteinpilze")
// Pilze ins Wasser Glas legen
BTC.Run("NamedGrabEvent/NamedOutline.INTERACTABLES.Steinpilze")
BTC.Set("Collider.INTERACTABLES.GlassWasserTrigger", "otherTag", "Steinpilze")
BTC.Run("Collider.INTERACTABLES.GlassWasserTrigger")
2024-07-19 19:56:36 +02:00
}
}
BTC.Disable("NamedGrabEvent/NamedOutline.INTERACTABLES.Steinpilze")
}
2024-07-19 19:56:36 +02:00
}
Tree("32_Grotto_Kueche_Zwiebeln_schneiden") {
2024-09-19 17:27:15 +02:00
// --- Kueche - Zwiebeln schneiden ---
2024-07-19 19:56:36 +02:00
Composite(Sequence) {
BTC.Run("AudioSource.AUDIO.Kueche1FZwiebelnsc")
2024-08-15 17:23:58 +02:00
// Zwiebeln schneiden
// ...
2024-07-19 19:56:36 +02:00
BTC.Run("AudioSource.AUDIO.Kueche2FZwiebelnsc")
// Zutaten leuchten
Composite(Marathon) {
BTC.Enable("NamedGrabEvent/NamedOutline.INTERACTABLES.Bouillon")
2024-08-15 17:23:58 +02:00
BTC.Show("GO/NamedSocketEvent.SOCKETS.BouillonSocket")
BTC.Enable("NamedGrabEvent/NamedOutline.INTERACTABLES.Weisswein")
2024-08-15 17:23:58 +02:00
BTC.Show("GO/NamedSocketEvent.SOCKETS.WeissweinSocket")
BTC.Enable("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Risotto")
2024-08-15 17:23:58 +02:00
BTC.Show("GO/NamedSocketEvent.SOCKETS.RisottoSocket")
BTC.Enable("NamedGrabEvent/NamedOutline.INTERACTABLES.Olivenoel")
2024-08-15 17:23:58 +02:00
BTC.Show("GO/NamedSocketEvent.SOCKETS.OlivenoelSocket")
BTC.Enable("NamedGrabEvent/NamedOutline.INTERACTABLES.Pfeffer")
2024-08-15 17:23:58 +02:00
BTC.Show("GO/NamedSocketEvent.SOCKETS.PfefferSocket")
BTC.Enable("NamedGrabEvent/NamedOutline.INTERACTABLES.Salz")
2024-08-15 17:23:58 +02:00
BTC.Show("GO/NamedSocketEvent.SOCKETS.SalzSocket")
}
2024-07-19 19:56:36 +02:00
2024-08-02 16:38:48 +02:00
// Zutaten auf die Arbeitsflaeche legen mithilfe Sockets
Composite(Marathon) {
2024-08-15 17:23:58 +02:00
Decorator (RepeatUntilFailed) {
Decorator(Inverter) {
2024-08-14 17:33:21 +02:00
Composite(Sequence) {
BTC.Run("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Risotto")
//BTC.GetKeyDown("Return")
2024-08-15 17:23:58 +02:00
Composite(Race) {
Composite(Sequence) {
// Success
BTC.Run("GO/NamedSocketEvent.SOCKETS.RisottoSocket")
2024-09-24 17:33:08 +02:00
//BTC.GetKeyDown("Return")
BTC.SetBool("RisottoIsSnapped")
BTC.Disable("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Risotto")
2024-08-15 17:23:58 +02:00
}
Composite(Sequence) {
// Fail
2024-09-24 17:33:08 +02:00
//BTC.GetKeyDown("Space")
BTC.ListenToEvent("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Risotto")
BTC.CompareBool("RisottoIsSnapped", false)
// Objekt geht zurueck
BTC.SetPosition("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Risotto", -6.733, 1.362, -18.908)
BTC.SynthesizeText("Das hast du an den falschen Ort gestellt.", "de-DE", "")
BTC.SpeechOutputEnded()
BTC.SetBool("RisottoIsSnapped", false)
2024-08-15 17:23:58 +02:00
}
}
2024-09-24 17:33:08 +02:00
BTC.CompareBool("RisottoIsSnapped")
2024-08-15 17:23:58 +02:00
} // Sequence
}
} // Repeat
Composite(Sequence) {
BTC.Run("NamedGrabEvent/NamedOutline.INTERACTABLES.Salz")
BTC.Disable("NamedGrabEvent/NamedOutline.INTERACTABLES.Salz")
BTC.Run("GO/NamedSocketEvent.SOCKETS.SalzSocket")
}
Composite(Sequence) {
2024-08-15 17:23:58 +02:00
BTC.Run("NamedGrabEvent/NamedOutline.INTERACTABLES.Pfeffer")
BTC.Disable("NamedGrabEvent/NamedOutline.INTERACTABLES.Pfeffer")
BTC.Run("GO/NamedSocketEvent.SOCKETS.PfefferSocket")
}
Composite(Sequence) {
2024-08-15 17:23:58 +02:00
BTC.Run("NamedGrabEvent/NamedOutline.INTERACTABLES.Weisswein")
BTC.Disable("NamedGrabEvent/NamedOutline.INTERACTABLES.Weisswein")
BTC.Run("GO/NamedSocketEvent.SOCKETS.WeissweinSocket")
}
Composite(Sequence) {
2024-08-15 17:23:58 +02:00
BTC.Run("NamedGrabEvent/NamedOutline.INTERACTABLES.Bouillon")
BTC.Disable("NamedGrabEvent/NamedOutline.INTERACTABLES.Bouillon")
BTC.Run("GO/NamedSocketEvent.SOCKETS.BouillonSocket")
}
Composite(Sequence) {
2024-08-15 17:23:58 +02:00
BTC.Run("NamedGrabEvent/NamedOutline.INTERACTABLES.Olivenoel")
BTC.Disable("NamedGrabEvent/NamedOutline.INTERACTABLES.Olivenoel")
BTC.Run("GO/NamedSocketEvent.SOCKETS.OlivenoelSocket")
}
}
2024-09-24 17:33:08 +02:00
BTC.SetBool("RisottoIsSnapped", false)
BTC.Wait(1)
Composite(Marathon) {
BTC.Hide("GO/NamedSocketEvent.SOCKETS.OlivenoelSocket")
BTC.Hide("GO/NamedSocketEvent.SOCKETS.BouillonSocket")
BTC.Hide("GO/NamedSocketEvent.SOCKETS.WeissweinSocket")
BTC.Hide("GO/NamedSocketEvent.SOCKETS.PfefferSocket")
BTC.Hide("GO/NamedSocketEvent.SOCKETS.SalzSocket")
BTC.Hide("GO/NamedSocketEvent.SOCKETS.RisottoSocket")
}
2024-07-19 19:56:36 +02:00
}
}
Tree("32_Grotto_Kueche_alles_gefunden") {
2024-09-19 17:27:15 +02:00
// --- Kueche - alles gefunden ---
2024-07-19 19:56:36 +02:00
Composite(Sequence) {
BTC.SynthesizeText("Super, du hast alles gefunden. Bitte gib nun etwas Olivenöl in den Topf.", "de-DE", "")
BTC.SpeechOutputEnded()
2024-07-19 19:56:36 +02:00
// Oel in Topf geben - Particle Trigger
// ...
BTC.Run("AudioSource.AUDIO.Kueche2Fallesgefun")
//BTC.GetKeyDown("Return")
2024-07-19 19:56:36 +02:00
// Zwiebeln in Topf geben
BTC.Run("NamedGrabEvent.INTERACTABLES.Zwiebeln")
BTC.Set("Collider.INTERACTABLES.Topf", "otherTag", "Zwiebeln")
BTC.Run("Collider.INTERACTABLES.Topf")
BTC.Run("AudioSource.AUDIO.Kueche3Fallesgefun")
2024-07-19 19:56:36 +02:00
// Frage beantworten
2024-09-19 17:27:15 +02:00
BTC.AddPossbileSpeechIntent("Kueche.alles_gefunden.4", "Ja.")
BTC.AddPossbileSpeechIntent("Kueche.alles_gefunden.6", "Nein.")
BTC.StartSpeechIntentRecognition()
2024-07-19 19:56:36 +02:00
Composite(Race) {
2024-09-19 17:27:15 +02:00
// -- Race 1: User sagt etwas
2024-07-19 19:56:36 +02:00
Composite(Sequence) {
2024-09-19 17:27:15 +02:00
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.Set("TextMeshPro.HANDMENU.Option1Button", "text", "Ja")
BTC.Show("GO.HANDMENU.Option1Button")
BTC.Set("TextMeshPro.HANDMENU.Option2Button", "text", "Nein")
BTC.Show("GO.HANDMENU.Option2Button")
}
Composite(Race) {
Composite(Sequence) {
// Ja
BTC.Run("NamedEventTrigger.HANDMENU.Option1Button")
BTC.AbortEventListener("NamedEventTrigger.HANDMENU.Option2Button")
2024-09-19 17:27:15 +02:00
BTC.Hide("GO.HANDMENU.Option1Button")
BTC.Hide("GO.HANDMENU.Option2Button")
RunTree("32_Grotto_Kueche_Interesse_Kochen")
}
Composite(Sequence) {
// Nein
BTC.Run("NamedEventTrigger.HANDMENU.Option2Button")
BTC.AbortEventListener("NamedEventTrigger.HANDMENU.Option1Button")
2024-09-19 17:27:15 +02:00
BTC.Hide("GO.HANDMENU.Option1Button")
BTC.Hide("GO.HANDMENU.Option2Button")
RunTree("32_Grotto_Kueche_Zusammen_Kochen")
}
}
}
}
2024-07-19 19:56:36 +02:00
}
2024-09-19 17:27:15 +02:00
// -- Race 2: User sagt nichts
2024-07-19 19:56:36 +02:00
Composite(Sequence) {
2024-09-19 17:27:15 +02:00
BTC.Wait(5)
BTC.CompareUserSpeechInputStarted(false)
BTC.AbortSpeechEventListener()
2024-09-19 17:27:15 +02:00
BTC.StopSpeechIntentRecognition()
BTC.ClearPossbileSpeechIntents()
// Fallback Button
Composite(Marathon) {
BTC.Set("TextMeshPro.HANDMENU.Option1Button", "text", "Ja")
BTC.Show("GO.HANDMENU.Option1Button")
BTC.Set("TextMeshPro.HANDMENU.Option2Button", "text", "Nein")
BTC.Show("GO.HANDMENU.Option2Button")
}
Composite(Race) {
Composite(Sequence) {
// Ja
BTC.Run("NamedEventTrigger.HANDMENU.Option1Button")
BTC.AbortEventListener("NamedEventTrigger.HANDMENU.Option2Button")
2024-09-19 17:27:15 +02:00
BTC.Hide("GO.HANDMENU.Option1Button")
BTC.Hide("GO.HANDMENU.Option2Button")
RunTree("32_Grotto_Kueche_Interesse_Kochen")
}
Composite(Sequence) {
// Nein
BTC.Run("NamedEventTrigger.HANDMENU.Option2Button")
BTC.AbortEventListener("NamedEventTrigger.HANDMENU.Option1Button")
2024-09-19 17:27:15 +02:00
BTC.Hide("GO.HANDMENU.Option1Button")
BTC.Hide("GO.HANDMENU.Option2Button")
RunTree("32_Grotto_Kueche_Zusammen_Kochen")
}
}
2024-07-19 19:56:36 +02:00
}
2024-09-19 17:27:15 +02:00
}
2024-07-19 19:56:36 +02:00
}
}
Tree("32_Grotto_Kueche_Interesse_Kochen") {
2024-09-19 17:27:15 +02:00
// --- Kueche - Interesse Kochen ---
2024-07-19 19:56:36 +02:00
Composite(Sequence) {
BTC.Run("AudioSource.AUDIO.Kueche1FInteresseK")
BTC.Set("TextMeshPro.HANDMENU.Option1Button", "text", "Lasagne")
BTC.Show("GO.HANDMENU.Option1Button")
2024-09-19 17:27:15 +02:00
BTC.SetBool("32_Grotto_Kueche_Interesse_Kochen_Button_Clicked", false)
2024-07-19 19:56:36 +02:00
Composite(Race) {
Composite(Sequence) {
// Lieblingsessen nennen
BTC.Run("NamedEventTrigger.HANDMENU.Option1Button")
2024-09-19 17:27:15 +02:00
BTC.SetBool("32_Grotto_Kueche_Interesse_Kochen_Button_Clicked")
BTC.Hide("GO.HANDMENU.Option1Button")
2024-07-19 19:56:36 +02:00
RunTree("32_Grotto_Kueche_Kochen_Anzahl")
}
Composite(Sequence) {
// keine Antwort
BTC.Wait(5)
2024-09-19 17:27:15 +02:00
BTC.CompareBool("32_Grotto_Kueche_Interesse_Kochen_Button_Clicked", false)
2024-09-24 17:33:08 +02:00
BTC.AbortEventListener("NamedEventTrigger.HANDMENU.Option1Button")
2024-09-19 17:27:15 +02:00
BTC.Hide("GO.HANDMENU.Option1Button")
2024-07-19 19:56:36 +02:00
RunTree("32_Grotto_Kueche_Zusammen_Kochen")
}
}
}
}
Tree("32_Grotto_Kueche_Kochen_Anzahl") {
2024-09-19 17:27:15 +02:00
// --- Kueche - Kochen Anzahl ---
2024-07-19 19:56:36 +02:00
Composite(Sequence) {
BTC.Run("AudioSource.AUDIO.Kueche1FKochenAnza")
// Frage beantworten
2024-09-19 17:27:15 +02:00
BTC.AddPossbileSpeechIntent("Kueche.Kochen_Anzahl.2", "sehr oft, fast täglich (oder andere Antwort)")
BTC.AddPossbileSpeechIntent("Kueche.Kochen_Anzahl.4", "fast nie (oder andere Antwort)")
BTC.StartSpeechIntentRecognition()
2024-07-19 19:56:36 +02:00
Composite(Race) {
2024-09-19 17:27:15 +02:00
// -- Race 1: User sagt etwas
2024-07-19 19:56:36 +02:00
Composite(Sequence) {
2024-09-19 17:27:15 +02:00
BTC.UserStartedSpeechInput()
Composite(Selector) {
// -- Selector 1: Intent erkannt
Composite(Sequence) {
BTC.SpeechIntentRecognized()
// Intent erkannt
Composite(Race) {
Composite(Sequence) {
BTC.CompareIntentID("Kueche.Kochen_Anzahl.2")
BTC.ClearPossbileSpeechIntents()
RunTree("32_Grotto_Kueche_Selbststaendig_Kochen")
}
Composite(Sequence) {
BTC.CompareIntentID("Kueche.Kochen_Anzahl.4")
BTC.ClearPossbileSpeechIntents()
RunTree("32_Grotto_Kueche_Zusammen_Kochen")
}
}
}
// -- Selector 2: Intent nicht erkannt
Composite(Sequence) {
BTC.ClearPossbileSpeechIntents()
// Fallback Button
Composite(Marathon) {
BTC.Set("TextMeshPro.HANDMENU.Option1Button", "text", "sehr oft")
BTC.Show("GO.HANDMENU.Option1Button")
BTC.Set("TextMeshPro.HANDMENU.Option2Button", "text", "selten")
BTC.Show("GO.HANDMENU.Option2Button")
}
Composite(Race) {
Composite(Sequence) {
// sehr oft
BTC.Run("NamedEventTrigger.HANDMENU.Option1Button")
BTC.AbortEventListener("NamedEventTrigger.HANDMENU.Option2Button")
2024-09-19 17:27:15 +02:00
BTC.Hide("GO.HANDMENU.Option1Button")
BTC.Hide("GO.HANDMENU.Option2Button")
RunTree("32_Grotto_Kueche_Selbststaendig_Kochen")
}
Composite(Sequence) {
// selten
BTC.Run("NamedEventTrigger.HANDMENU.Option2Button")
BTC.AbortEventListener("NamedEventTrigger.HANDMENU.Option1Button")
2024-09-19 17:27:15 +02:00
BTC.Hide("GO.HANDMENU.Option1Button")
BTC.Hide("GO.HANDMENU.Option2Button")
RunTree("32_Grotto_Kueche_Zusammen_Kochen")
}
}
}
}
2024-07-19 19:56:36 +02:00
}
2024-09-19 17:27:15 +02:00
// -- Race 2: User sagt nichts
2024-07-19 19:56:36 +02:00
Composite(Sequence) {
BTC.Wait(5)
2024-09-19 17:27:15 +02:00
BTC.CompareUserSpeechInputStarted(false)
BTC.AbortSpeechEventListener()
2024-09-19 17:27:15 +02:00
BTC.StopSpeechIntentRecognition()
BTC.ClearPossbileSpeechIntents()
2024-07-19 19:56:36 +02:00
RunTree("32_Grotto_Kueche_Zusammen_Kochen")
}
2024-09-19 17:27:15 +02:00
}
2024-07-17 10:56:22 +02:00
}
}
2024-07-19 19:56:36 +02:00
Tree("32_Grotto_Kueche_Zusammen_Kochen") {
2024-09-19 17:27:15 +02:00
// --- Kueche - Zusammen Kochen ---
2024-07-19 19:56:36 +02:00
Composite(Sequence) {
2024-07-30 17:25:03 +02:00
BTC.Run("AudioSource.AUDIO.Kueche1FZusammenKo")
// Risotto in Topf geben
BTC.Run("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Risotto")
2024-07-30 17:25:03 +02:00
BTC.Set("Collider.INTERACTABLES.Topf", "otherTag", "Risotto")
BTC.Run("Collider.INTERACTABLES.Topf")
// Ruehren
BTC.Run("NamedGrabEvent.INTERACTABLES.Loeffel")
BTC.Set("Collider.INTERACTABLES.Topf", "otherTag", "Loeffel")
BTC.Run("Collider.INTERACTABLES.Topf")
// Wie lange ruehren?
BTC.Wait(2)
2024-07-30 17:25:03 +02:00
BTC.Run("AudioSource.AUDIO.Kueche2FZusammenKo")
// Wein leuchtet
BTC.Enable("NamedGrabEvent/NamedOutline.INTERACTABLES.Weisswein")
2024-07-30 17:25:03 +02:00
// Wein greifen
BTC.Run("NamedGrabEvent/NamedOutline.INTERACTABLES.Weisswein")
BTC.Disable("NamedGrabEvent/NamedOutline.INTERACTABLES.Weisswein")
2024-07-30 17:25:03 +02:00
// Wein in Topf giessen
// ...
BTC.Run("AudioSource.AUDIO.Kueche3FZusammenKo")
// Bouillon leuchtet
BTC.Enable("NamedGrabEvent/NamedOutline.INTERACTABLES.Bouillon")
2024-07-30 17:25:03 +02:00
// Bouillon greifen
BTC.Run("NamedGrabEvent/NamedOutline.INTERACTABLES.Bouillon")
BTC.Disable("NamedGrabEvent/NamedOutline.INTERACTABLES.Bouillon")
2024-07-30 17:25:03 +02:00
// Bouillon in Topf geben
// ...
BTC.Run("AudioSource.AUDIO.Kueche4FZusammenKo")
// Glas Wasser mit Steinpilze in Topf geben
BTC.Run("NamedGrabEvent/NamedOutline.INTERACTABLES.Steinpilze")
2024-07-30 17:25:03 +02:00
BTC.Set("Collider.INTERACTABLES.Topf", "otherTag", "Steinpilze")
BTC.Run("Collider.INTERACTABLES.Topf")
RunTree("32_Grotto_Kueche_Parmigiano")
}
}
Tree("32_Grotto_Kueche_Selbststaendig_Kochen") {
2024-09-19 17:27:15 +02:00
// --- Kueche - Selbststaendig Kochen ---
Composite(Sequence) {
BTC.Run("AudioSource.AUDIO.Kueche1FSelbststae")
// Selbstaendig kochen...
// ...
RunTree("32_Grotto_Kueche_Parmigiano")
}
}
Tree("32_Grotto_Kueche_Parmigiano") {
2024-09-19 17:27:15 +02:00
// --- Kueche - Parmigiano ---
Composite(Sequence) {
2024-09-24 17:33:08 +02:00
BTC.SynthesizeText("Schau, ich habe dir den Parmigiano hingestellt. Du kannst ihn nun in den Topf geben.", "de-DE", "")
BTC.SpeechOutputEnded()
// Parmigiano in Topf geben
BTC.Run("NamedGrabEvent.INTERACTABLES.Parmigiano")
BTC.Set("Collider.INTERACTABLES.Topf", "otherTag", "Parmigiano")
BTC.Run("Collider.INTERACTABLES.Topf")
2024-09-24 17:33:08 +02:00
BTC.SynthesizeText("Bist du fertig?", "de-DE", "")
BTC.SpeechOutputEnded()
// Antwort User
2024-09-24 17:33:08 +02:00
// ToDo: Sprache fehlt
BTC.Set("TextMeshPro.HANDMENU.Option1Button", "text", "Ja")
BTC.Show("GO.HANDMENU.Option1Button")
Composite(Race) {
BTC.Run("NamedEventTrigger.HANDMENU.Option1Button")
BTC.Wait(5)
}
BTC.Hide("GO.HANDMENU.Option1Button")
2024-09-24 17:33:08 +02:00
BTC.SynthesizeText("Bitte stelle den Risotto hier hin.", "de-DE", "")
BTC.SpeechOutputEnded()
// Stelle für Pfanne leuchtet
BTC.Enable("Collider/NamedOutline.INTERACTABLES.TopfUntersetzer")
2024-07-30 17:25:03 +02:00
// Pfanne rueber stellen
BTC.Run("NamedGrabEvent.INTERACTABLES.Topf")
BTC.Set("Collider/NamedOutline.INTERACTABLES.TopfUntersetzer", "otherTag", "Topf")
BTC.Run("Collider/NamedOutline.INTERACTABLES.TopfUntersetzer")
BTC.Disable("Collider/NamedOutline.INTERACTABLES.TopfUntersetzer")
2024-09-24 17:33:08 +02:00
// ToDo: Fallback Keine Reaktion
2024-07-30 17:25:03 +02:00
BTC.Run("AudioSource.AUDIO.Kueche5FZusammenKo")
BTC.Run("AudioSource.AUDIO.Kueche6FZusammenKo")
2024-09-19 17:27:15 +02:00
// --- Kueche - Outro ---
2024-07-30 17:25:03 +02:00
BTC.Run("AudioSource.AUDIO.Kueche1GOutro")
2024-09-24 17:33:08 +02:00
BTC.SynthesizeText("Ich bin Giuseppe, Francescas Grossonkel. Und wer bist du?", "de-DE", "")
BTC.SpeechOutputEnded()
2024-07-30 17:25:03 +02:00
// Name sagen
2024-09-24 17:33:08 +02:00
BTC.AddPossbileSpeechIntent("Kueche.Outro.4", "Mein Name ist xy. (oder andere Antwort)")
2024-09-19 17:27:15 +02:00
BTC.StartSpeechIntentRecognition()
2024-07-30 17:25:03 +02:00
Composite(Race) {
2024-09-19 17:27:15 +02:00
// -- 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()
// Fallback Button
BTC.Set("TextMeshPro.HANDMENU.Option1Button", "text", "Mein Name ist User.")
BTC.Show("GO.HANDMENU.Option1Button")
BTC.Run("NamedEventTrigger.HANDMENU.Option1Button")
BTC.Hide("GO.HANDMENU.Option1Button")
}
}
}
// -- Race 2: User sagt nichts
Composite(Sequence) {
BTC.Wait(5)
BTC.CompareUserSpeechInputStarted(false)
BTC.AbortSpeechEventListener()
2024-09-19 17:27:15 +02:00
BTC.StopSpeechIntentRecognition()
BTC.ClearPossbileSpeechIntents()
}
}
2024-07-30 17:25:03 +02:00
BTC.Run("AudioSource.AUDIO.Kueche3GOutro")
2024-09-24 17:33:08 +02:00
BTC.Run("AudioSource.AUDIO.Kueche2GOutro")
}
2024-07-19 19:56:36 +02:00
}
2024-07-17 10:56:22 +02:00
Tree("32_Grotto_Kueche_Hide") {
2024-06-05 16:23:48 +02:00
Composite(Sequence) {
// Go to scene 3.5 Slideshow
BTC.GetKeyDown("Return")
BTC.Run("LoadScene.NEXT.35Slideshow")
}
}