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

585 lines
22 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

Tree("Root") {
Composite(Sequence) {
//RunTree("32_Grotto_Kueche_Intro")
//RunTree("32_Grotto_Kueche_Zwiebeln_schneiden")
// RunTree("32_Grotto_Kueche_alles_gefunden")
//RunTree("32_Grotto_Kueche_Zusammen_Kochen")
RunTree("32_Grotto_Chatbot_Test")
}
}
Tree("32_Grotto_Chatbot_Test") {
Composite(Sequence) {
BTC.InitializeSpeechManager()
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", "")
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) {
Composite(Sequence) {
BTC.UserStartedSpeechInput()
RunTree("32_Grotto_Chatbot_Test_Compare_Intent")
}
Composite(Sequence) {
BTC.Wait(5)
BTC.CompareUserSpeechInputStarted(false)
BTC.StopSpeechIntentRecognition()
BTC.ClearPossbileSpeechIntents()
// Bilder Bergell
//BTC.Run("LoadScene.NEXT.35Slideshow")
}
}
}
}
Tree("32_Grotto_Chatbot_Test_Compare_Intent") {
Composite(Sequence) {
Composite(Selector) {
Composite(Sequence) {
BTC.SpeechIntentRecognized()
// Intent erkannt
Composite(Race) {
Composite(Sequence) {
BTC.CompareIntentID("Story_B_Grotto.Nachfrage_Nonna_Grotto.2")
RunTree("Antwort_Nonna_Kueche")
}
Composite(Sequence) {
BTC.CompareIntentID("Story_B_Grotto.Nachfrage_Nonna_Grotto.4")
RunTree("Antwort_Nonna_Grotto")
}
}
}
Composite(Sequence) {
// 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()
BTC.StartSpeechIntentRecognition()
// Fallback fehlt, wenn nichts gesagt wird
BTC.UserStartedSpeechInput()
BTC.SpeechIntentRecognized()
Composite(Race) {
Composite(Sequence) {
BTC.CompareIntentID("Story_B_Grotto.Nachfrage_Nonna_Grotto.2")
RunTree("Antwort_Nonna_Kueche")
}
Composite(Sequence) {
BTC.CompareIntentID("Story_B_Grotto.Nachfrage_Nonna_Grotto.4")
RunTree("Antwort_Nonna_Grotto")
}
}
}
// Fallback 2mal nicht verstanden: Button klick
}
}
}
Tree("Antwort_Nonna_Kueche") {
Composite(Sequence) {
BTC.ClearPossbileSpeechIntents()
BTC.SynthesizeText("Oh, das ist wunderbar, vielen Dank! Anschliessend seid ihr selbstverständlich zum Essen eingeladen.", "de-DE", "")
BTC.SpeechOutputEnded()
//BTC.AddPossbileSpeechIntent("Story_B_Grotto.Antwort_Nonna_Kueche.2", "Tante grazie, è molto gentile da parte Sua (o altra risposta).")
BTC.AddPossbileSpeechIntent("Story_B_Grotto.Antwort_Nonna_Kueche.2", "Vielen Dank, das ist nett (oder andere Antwort)")
BTC.StartSpeechIntentRecognition()
Composite(Race) {
Composite(Selector) {
Composite(Sequence) {
BTC.UserStartedSpeechInput()
BTC.SpeechIntentRecognized()
BTC.ClearPossbileSpeechIntents()
// --- Outro ---
//BTC.GetKeyDown("Return")
}
// Intent nicht erkannt
Composite(Sequence) {
BTC.ClearPossbileSpeechIntents()
// --- Outro ---
//BTC.GetKeyDown("Return")
}
}
Composite(Sequence) {
BTC.Wait(5)
BTC.CompareUserSpeechInputStarted(false)
BTC.StopSpeechIntentRecognition()
BTC.ClearPossbileSpeechIntents()
// --- Outro ---
//BTC.GetKeyDown("Return")
}
}
}
}
Tree("Antwort_Nonna_Grotto") {
Composite(Sequence) {
BTC.ClearPossbileSpeechIntents()
BTC.SynthesizeText("Okay gut, mach es dir gemütlich. Hast du etwas zum Lesen dabei?", "de-DE", "")
BTC.SpeechOutputEnded()
//BTC.AddPossbileSpeechIntent("Story_B_Grotto.Antwort_Nonna_Grotto.2", "Sì, grazie, ho qualcosa con me (o un'altra risposta)")
BTC.AddPossbileSpeechIntent("Story_B_Grotto.Antwort_Nonna_Grotto.2", "Ja, danke, ich habe etwas dabei (oder andere Antwort)")
BTC.StartSpeechIntentRecognition()
Composite(Race) {
Composite(Selector) {
Composite(Sequence) {
BTC.UserStartedSpeechInput()
BTC.SpeechIntentRecognized()
RunTree("Antwort_Nonna_Grotto_2")
}
// Intent nicht erkannt
Composite(Sequence) {
RunTree("Antwort_Nonna_Grotto_2")
}
}
Composite(Sequence) {
BTC.Wait(5)
BTC.CompareUserSpeechInputStarted(false)
BTC.StopSpeechIntentRecognition()
RunTree("Antwort_Nonna_Grotto_2")
}
}
}
}
Tree("Antwort_Nonna_Grotto_2") {
Composite(Sequence) {
BTC.ClearPossbileSpeechIntents()
BTC.SynthesizeText("Prima, viel Spass noch und dann guten Appetit!", "de-DE", "")
BTC.SpeechOutputEnded()
//BTC.AddPossbileSpeechIntent("Story_B_Grotto.Antwort_Nonna_Grotto.6", "Grazie nonna, ciao!")
BTC.AddPossbileSpeechIntent("Story_B_Grotto.Antwort_Nonna_Grotto.6", "Danke!")
BTC.StartSpeechIntentRecognition()
Composite(Race) {
Composite(Selector) {
Composite(Sequence) {
BTC.UserStartedSpeechInput()
BTC.SpeechIntentRecognized()
BTC.ClearPossbileSpeechIntents()
//BTC.GetKeyDown("Return")
}
// Intent nicht erkannt
Composite(Sequence) {
BTC.ClearPossbileSpeechIntents()
//BTC.GetKeyDown("Return")
}
}
Composite(Sequence) {
BTC.Wait(5)
BTC.CompareUserSpeechInputStarted(false)
BTC.StopSpeechIntentRecognition()
BTC.ClearPossbileSpeechIntents()
//BTC.GetKeyDown("Return")
}
}
}
}
Tree("32_Grotto_Kueche_Intro") {
Composite(Sequence) {
BTC.Run("AudioSource.AUDIO.Kueche1FIntro")
// Schuerze greifen
//BTC.GetKeyDown("Return")
BTC.Run("GO/NamedGrabEvent.INTERACTABLES.Schuerze")
BTC.Hide("GO/NamedGrabEvent.INTERACTABLES.Schuerze")
BTC.Run("AudioSource.AUDIO.Kueche2FIntro")
// Rezept vorlesen: Button Klick
BTC.Set("TextMeshPro.HANDMENU.Option1Button", "text", "Rezept vorlesen")
BTC.Show("GO.HANDMENU.Option1Button")
Composite(Race) {
Composite(Sequence) {
// auf Button klicken
BTC.Run("NamedEventTrigger.HANDMENU.Option1Button")
//BTC.GetKeyDown("Return")
}
Composite(Sequence) {
// keine Reaktion
BTC.Wait(5)
// BTC.Run(Audio)
BTC.Run("NamedEventTrigger.HANDMENU.Option1Button")
}
}
BTC.Hide("GO.HANDMENU.Option1Button")
BTC.Run("AudioSource.AUDIO.Kueche3FIntro")
// Pilze leuchten
BTC.Enable("NamedGrabEvent/NamedOutline.INTERACTABLES.Steinpilze")
Composite(Race) {
Composite(Sequence) {
// 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
BTC.Wait(5)
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")
}
}
BTC.Disable("NamedGrabEvent/NamedOutline.INTERACTABLES.Steinpilze")
}
}
Tree("32_Grotto_Kueche_Zwiebeln_schneiden") {
Composite(Sequence) {
BTC.Run("AudioSource.AUDIO.Kueche1FZwiebelnsc")
// Zwiebeln schneiden
// ...
BTC.Run("AudioSource.AUDIO.Kueche2FZwiebelnsc")
// Zutaten leuchten
Composite(Marathon) {
BTC.Enable("NamedGrabEvent/NamedOutline.INTERACTABLES.Bouillon")
BTC.Show("GO/NamedSocketEvent.SOCKETS.BouillonSocket")
BTC.Enable("NamedGrabEvent/NamedOutline.INTERACTABLES.Weisswein")
BTC.Show("GO/NamedSocketEvent.SOCKETS.WeissweinSocket")
BTC.Enable("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Risotto")
BTC.Show("GO/NamedSocketEvent.SOCKETS.RisottoSocket")
BTC.Enable("NamedGrabEvent/NamedOutline.INTERACTABLES.Olivenoel")
BTC.Show("GO/NamedSocketEvent.SOCKETS.OlivenoelSocket")
BTC.Enable("NamedGrabEvent/NamedOutline.INTERACTABLES.Pfeffer")
BTC.Show("GO/NamedSocketEvent.SOCKETS.PfefferSocket")
BTC.Enable("NamedGrabEvent/NamedOutline.INTERACTABLES.Salz")
BTC.Show("GO/NamedSocketEvent.SOCKETS.SalzSocket")
}
// Zutaten auf die Arbeitsflaeche legen mithilfe Sockets
Composite(Marathon) {
Decorator (RepeatUntilFailed) {
Decorator(Inverter) {
Composite(Sequence) {
BTC.Run("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Risotto")
//BTC.GetKeyDown("Return")
Composite(Race) {
Composite(Sequence) {
// Success
BTC.Run("GO/NamedSocketEvent.SOCKETS.RisottoSocket")
BTC.Disable("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Risotto")
BTC.SetBool("IsSnapped")
}
Composite(Sequence) {
// Fail
BTC.Run("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Risotto")
Composite(Marathon) {
BTC.Run("AudioSource.AUDIO.Kueche2FZwiebelnsc")
// Objekt geht zurueck
BTC.SetPosition("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Risotto", -6.733, 1.362, -18.908)
}
BTC.SetBool("IsSnapped", false)
}
}
BTC.CompareBool("IsSnapped")
} // Sequence
}
} // Repeat
Composite(Sequence) {
BTC.Run("NamedGrabEvent/NamedOutline.INTERACTABLES.Salz")
BTC.Disable("NamedGrabEvent/NamedOutline.INTERACTABLES.Salz")
BTC.Run("GO/NamedSocketEvent.SOCKETS.SalzSocket")
}
Composite(Sequence) {
BTC.Run("NamedGrabEvent/NamedOutline.INTERACTABLES.Pfeffer")
BTC.Disable("NamedGrabEvent/NamedOutline.INTERACTABLES.Pfeffer")
BTC.Run("GO/NamedSocketEvent.SOCKETS.PfefferSocket")
}
Composite(Sequence) {
BTC.Run("NamedGrabEvent/NamedOutline.INTERACTABLES.Weisswein")
BTC.Disable("NamedGrabEvent/NamedOutline.INTERACTABLES.Weisswein")
BTC.Run("GO/NamedSocketEvent.SOCKETS.WeissweinSocket")
}
Composite(Sequence) {
BTC.Run("NamedGrabEvent/NamedOutline.INTERACTABLES.Bouillon")
BTC.Disable("NamedGrabEvent/NamedOutline.INTERACTABLES.Bouillon")
BTC.Run("GO/NamedSocketEvent.SOCKETS.BouillonSocket")
}
Composite(Sequence) {
BTC.Run("NamedGrabEvent/NamedOutline.INTERACTABLES.Olivenoel")
BTC.Disable("NamedGrabEvent/NamedOutline.INTERACTABLES.Olivenoel")
BTC.Run("GO/NamedSocketEvent.SOCKETS.OlivenoelSocket")
}
}
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")
}
}
}
Tree("32_Grotto_Kueche_alles_gefunden") {
Composite(Sequence) {
BTC.Run("AudioSource.AUDIO.Kueche2Fallesgefun") // Audio fehlt
// Oel in Topf geben - Particle Trigger
// ...
BTC.Run("AudioSource.AUDIO.Kueche2Fallesgefun")
// 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")
// Frage beantworten
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.Hide("GO.HANDMENU.Option1Button")
BTC.Hide("GO.HANDMENU.Option2Button")
RunTree("32_Grotto_Kueche_Interesse_Kochen")
}
Composite(Sequence) {
// Nein
BTC.Run("NamedEventTrigger.HANDMENU.Option2Button")
BTC.Hide("GO.HANDMENU.Option1Button")
BTC.Hide("GO.HANDMENU.Option2Button")
RunTree("32_Grotto_Kueche_Zusammen_Kochen")
}
}
}
}
Tree("32_Grotto_Kueche_Interesse_Kochen") {
Composite(Sequence) {
BTC.Run("AudioSource.AUDIO.Kueche1FInteresseK")
BTC.Set("TextMeshPro.HANDMENU.Option1Button", "text", "Lasagne")
BTC.Show("GO.HANDMENU.Option1Button")
Composite(Race) {
Composite(Sequence) {
// Lieblingsessen nennen
BTC.Run("NamedEventTrigger.HANDMENU.Option1Button")
RunTree("32_Grotto_Kueche_Kochen_Anzahl")
}
Composite(Sequence) {
// keine Antwort
BTC.Wait(5)
RunTree("32_Grotto_Kueche_Zusammen_Kochen")
}
}
}
}
Tree("32_Grotto_Kueche_Kochen_Anzahl") {
Composite(Sequence) {
BTC.Run("AudioSource.AUDIO.Kueche1FKochenAnza")
// Frage beantworten
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.Hide("GO.HANDMENU.Option1Button")
BTC.Hide("GO.HANDMENU.Option2Button")
RunTree("32_Grotto_Kueche_Selbststaendig_Kochen")
}
Composite(Sequence) {
// selten
BTC.Run("NamedEventTrigger.HANDMENU.Option2Button")
BTC.Hide("GO.HANDMENU.Option1Button")
BTC.Hide("GO.HANDMENU.Option2Button")
RunTree("32_Grotto_Kueche_Zusammen_Kochen")
}
Composite(Sequence) {
// keine Antwort
BTC.Wait(5)
BTC.Hide("GO.HANDMENU.Option1Button")
BTC.Hide("GO.HANDMENU.Option2Button")
RunTree("32_Grotto_Kueche_Zusammen_Kochen")
}
}
}
}
Tree("32_Grotto_Kueche_Zusammen_Kochen") {
Composite(Sequence) {
BTC.Run("AudioSource.AUDIO.Kueche1FZusammenKo")
// Risotto in Topf geben
BTC.Run("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Risotto")
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)
BTC.Run("AudioSource.AUDIO.Kueche2FZusammenKo")
// Wein leuchtet
BTC.Enable("NamedGrabEvent/NamedOutline.INTERACTABLES.Weisswein")
// Wein greifen
BTC.Run("NamedGrabEvent/NamedOutline.INTERACTABLES.Weisswein")
BTC.Disable("NamedGrabEvent/NamedOutline.INTERACTABLES.Weisswein")
// Wein in Topf giessen
// ...
BTC.Run("AudioSource.AUDIO.Kueche3FZusammenKo")
// Bouillon leuchtet
BTC.Enable("NamedGrabEvent/NamedOutline.INTERACTABLES.Bouillon")
// Bouillon greifen
BTC.Run("NamedGrabEvent/NamedOutline.INTERACTABLES.Bouillon")
BTC.Disable("NamedGrabEvent/NamedOutline.INTERACTABLES.Bouillon")
// Bouillon in Topf geben
// ...
BTC.Run("AudioSource.AUDIO.Kueche4FZusammenKo")
// Glas Wasser mit Steinpilze in Topf geben
BTC.Run("NamedGrabEvent/NamedOutline.INTERACTABLES.Steinpilze")
BTC.Set("Collider.INTERACTABLES.Topf", "otherTag", "Steinpilze")
BTC.Run("Collider.INTERACTABLES.Topf")
RunTree("32_Grotto_Kueche_Parmigiano")
}
}
Tree("32_Grotto_Kueche_Selbststaendig_Kochen") {
Composite(Sequence) {
BTC.Run("AudioSource.AUDIO.Kueche1FSelbststae")
// Selbstaendig kochen...
// ...
RunTree("32_Grotto_Kueche_Parmigiano")
}
}
Tree("32_Grotto_Kueche_Parmigiano") {
Composite(Sequence) {
BTC.Run("AudioSource.AUDIO.Kueche4FZusammenKo")
// Parmigiano in Topf geben
BTC.Run("NamedGrabEvent.INTERACTABLES.Parmigiano")
BTC.Set("Collider.INTERACTABLES.Topf", "otherTag", "Parmigiano")
BTC.Run("Collider.INTERACTABLES.Topf")
BTC.Run("AudioSource.AUDIO.Kueche4FZusammenKo") // Richtige Audio fehlt
// Antwort User
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")
BTC.Run("AudioSource.AUDIO.Kueche4FZusammenKo") // Richtige Audio fehlt
// Stelle für Pfanne leuchtet
BTC.Enable("Collider/NamedOutline.INTERACTABLES.TopfUntersetzer")
// 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")
BTC.Run("AudioSource.AUDIO.Kueche5FZusammenKo")
BTC.Run("AudioSource.AUDIO.Kueche6FZusammenKo")
// --- Outro ---
BTC.Run("AudioSource.AUDIO.Kueche1GOutro")
BTC.Run("AudioSource.AUDIO.Kueche2GOutro")
// Name sagen
BTC.Set("TextMeshPro.HANDMENU.Option1Button", "text", "Mein Name ist User.")
BTC.Show("GO.HANDMENU.Option1Button")
Composite(Race) {
BTC.Run("NamedEventTrigger.HANDMENU.Option1Button")
BTC.Wait(5)
}
BTC.Hide("GO.HANDMENU.Option1Button")
BTC.Run("AudioSource.AUDIO.Kueche3GOutro")
}
}
Tree("32_Grotto_Kueche_Hide") {
Composite(Sequence) {
// Go to scene 3.5 Slideshow
BTC.GetKeyDown("Return")
BTC.Run("LoadScene.NEXT.35Slideshow")
}
}