Grotto scene added speech intents

dev
Nadine Ganz 2024-09-19 17:27:15 +02:00
parent eafeee13c5
commit cf3ff5a5d1
3 changed files with 372892 additions and 238483 deletions

View File

@ -1,16 +1,18 @@
Tree("Root") {
Composite(Sequence) {
BTC.InitializeSpeechManager()
//RunTree("32_Grotto_Kueche_Intro")
//RunTree("32_Grotto_Kueche_Zwiebeln_schneiden")
// RunTree("32_Grotto_Kueche_alles_gefunden")
RunTree("32_Grotto_Kueche_alles_gefunden")
//RunTree("32_Grotto_Kueche_Zusammen_Kochen")
RunTree("32_Grotto_Chatbot_Test")
//RunTree("32_Grotto_Story_B_Grotto")
}
}
Tree("32_Grotto_Chatbot_Test") {
Tree("32_Grotto_Story_B_Grotto") {
// --- Story B Grotto - Antwort Reise ---
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()
@ -23,27 +25,12 @@ Tree("32_Grotto_Chatbot_Test") {
BTC.StartSpeechIntentRecognition()
Composite(Race) {
// -- Race 1: User sagt etwas
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) {
// -- Selector 1: Intent erkannt
Composite(Sequence) {
BTC.SpeechIntentRecognized()
@ -51,16 +38,20 @@ Tree("32_Grotto_Chatbot_Test_Compare_Intent") {
Composite(Race) {
Composite(Sequence) {
BTC.CompareIntentID("Story_B_Grotto.Nachfrage_Nonna_Grotto.2")
RunTree("Antwort_Nonna_Kueche")
BTC.ClearPossbileSpeechIntents()
RunTree("32_Grotto_Story_B_Grotto_Antwort_Nonna_Kueche")
}
Composite(Sequence) {
BTC.CompareIntentID("Story_B_Grotto.Nachfrage_Nonna_Grotto.4")
RunTree("Antwort_Nonna_Grotto")
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.SynthesizeText("Was wolltest du sagen? Ich habe es nicht verstanden. Möchtest du mithelfen oder lieber im Garten warten?", "de-DE", "")
BTC.SpeechOutputEnded()
@ -73,11 +64,13 @@ Tree("32_Grotto_Chatbot_Test_Compare_Intent") {
Composite(Race) {
Composite(Sequence) {
BTC.CompareIntentID("Story_B_Grotto.Nachfrage_Nonna_Grotto.2")
RunTree("Antwort_Nonna_Kueche")
BTC.ClearPossbileSpeechIntents()
RunTree("32_Grotto_Story_B_Grotto_Antwort_Nonna_Kueche")
}
Composite(Sequence) {
BTC.CompareIntentID("Story_B_Grotto.Nachfrage_Nonna_Grotto.4")
RunTree("Antwort_Nonna_Grotto")
BTC.ClearPossbileSpeechIntents()
RunTree("32_Grotto_Story_B_Grotto_Antwort_Nonna_Grotto")
}
}
}
@ -86,11 +79,24 @@ Tree("32_Grotto_Chatbot_Test_Compare_Intent") {
}
}
// -- Race 2: User sagt nichts
Composite(Sequence) {
BTC.Wait(5)
BTC.CompareUserSpeechInputStarted(false)
BTC.StopSpeechIntentRecognition()
BTC.ClearPossbileSpeechIntents()
// --- Bilder Bergell ---
//BTC.Run("LoadScene.NEXT.35Slideshow")
}
}
}
}
Tree("Antwort_Nonna_Kueche") {
Tree("32_Grotto_Story_B_Grotto_Antwort_Nonna_Kueche") {
// --- Story B Grotto - 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()
@ -99,38 +105,37 @@ Tree("Antwort_Nonna_Kueche") {
BTC.StartSpeechIntentRecognition()
Composite(Race) {
// -- Race 1: User sagt etwas
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")
}
}
// -- Race 2: User sagt nichts
Composite(Sequence) {
BTC.Wait(5)
BTC.CompareUserSpeechInputStarted(false)
BTC.StopSpeechIntentRecognition()
BTC.ClearPossbileSpeechIntents()
// --- Outro ---
//BTC.GetKeyDown("Return")
}
}
}
}
Tree("Antwort_Nonna_Grotto") {
// --- Story B Grotto - Outro ---
// ...
}
}
Tree("32_Grotto_Story_B_Grotto_Antwort_Nonna_Grotto") {
// --- Story B Grotto - 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()
@ -139,32 +144,28 @@ Tree("Antwort_Nonna_Grotto") {
BTC.StartSpeechIntentRecognition()
Composite(Race) {
// -- Race 1: User sagt etwas
Composite(Selector) {
Composite(Sequence) {
BTC.UserStartedSpeechInput()
BTC.SpeechIntentRecognized()
RunTree("Antwort_Nonna_Grotto_2")
BTC.ClearPossbileSpeechIntents()
}
// Intent nicht erkannt
Composite(Sequence) {
RunTree("Antwort_Nonna_Grotto_2")
BTC.ClearPossbileSpeechIntents()
}
}
// -- Race 2: User sagt nichts
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()
@ -174,6 +175,7 @@ Tree("Antwort_Nonna_Grotto_2") {
BTC.StartSpeechIntentRecognition()
Composite(Race) {
// -- Race 1: User sagt etwas
Composite(Selector) {
Composite(Sequence) {
BTC.UserStartedSpeechInput()
@ -189,6 +191,7 @@ Tree("Antwort_Nonna_Grotto_2") {
}
}
// -- Race 2: User sagt nichts
Composite(Sequence) {
BTC.Wait(5)
BTC.CompareUserSpeechInputStarted(false)
@ -201,6 +204,7 @@ Tree("Antwort_Nonna_Grotto_2") {
}
Tree("32_Grotto_Kueche_Intro") {
// --- Kueche - Intro ---
Composite(Sequence) {
BTC.Run("AudioSource.AUDIO.Kueche1FIntro")
@ -244,6 +248,7 @@ Tree("32_Grotto_Kueche_Intro") {
Composite(Sequence) {
// Keine Reaction
BTC.Wait(5)
// --- Kueche - Steinpilze Hilfe ---
BTC.Run("AudioSource.AUDIO.Kueche1FSteinpilze")
// Pilze ins Wasser Glas legen
BTC.Run("NamedGrabEvent/NamedOutline.INTERACTABLES.Steinpilze")
@ -256,6 +261,7 @@ Tree("32_Grotto_Kueche_Intro") {
}
Tree("32_Grotto_Kueche_Zwiebeln_schneiden") {
// --- Kueche - Zwiebeln schneiden ---
Composite(Sequence) {
BTC.Run("AudioSource.AUDIO.Kueche1FZwiebelnsc")
@ -365,19 +371,55 @@ Tree("32_Grotto_Kueche_Zwiebeln_schneiden") {
Tree("32_Grotto_Kueche_alles_gefunden") {
// --- Kueche - alles gefunden ---
Composite(Sequence) {
BTC.Run("AudioSource.AUDIO.Kueche2Fallesgefun") // Audio fehlt
// Oel in Topf geben - Particle Trigger
// ...
BTC.Run("AudioSource.AUDIO.Kueche2Fallesgefun")
BTC.GetKeyDown("Return")
// Zwiebeln in Topf geben
BTC.Run("NamedGrabEvent.INTERACTABLES.Zwiebeln")
/* BTC.Run("NamedGrabEvent.INTERACTABLES.Zwiebeln")
BTC.Set("Collider.INTERACTABLES.Topf", "otherTag", "Zwiebeln")
BTC.Run("Collider.INTERACTABLES.Topf")
BTC.Run("AudioSource.AUDIO.Kueche3Fallesgefun")
BTC.Run("AudioSource.AUDIO.Kueche3Fallesgefun")*/
// Frage beantworten
BTC.AddPossbileSpeechIntent("Kueche.alles_gefunden.4", "Ja.")
BTC.AddPossbileSpeechIntent("Kueche.alles_gefunden.6", "Nein.")
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.Set("TextMeshPro.HANDMENU.Option1Button", "text", "Ja")
BTC.Show("GO.HANDMENU.Option1Button")
@ -401,26 +443,68 @@ Tree("32_Grotto_Kueche_alles_gefunden") {
RunTree("32_Grotto_Kueche_Zusammen_Kochen")
}
}
}
}
}
// -- Race 2: User sagt nichts
Composite(Sequence) {
BTC.Wait(5)
BTC.CompareUserSpeechInputStarted(false)
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.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") {
// --- Kueche - Interesse Kochen ---
Composite(Sequence) {
BTC.Run("AudioSource.AUDIO.Kueche1FInteresseK")
BTC.Set("TextMeshPro.HANDMENU.Option1Button", "text", "Lasagne")
BTC.Show("GO.HANDMENU.Option1Button")
BTC.SetBool("32_Grotto_Kueche_Interesse_Kochen_Button_Clicked", false)
Composite(Race) {
Composite(Sequence) {
// Lieblingsessen nennen
BTC.Run("NamedEventTrigger.HANDMENU.Option1Button")
//BTC.Run("NamedEventTrigger.HANDMENU.Option1Button")
BTC.GetKeyDown("Return")
BTC.SetBool("32_Grotto_Kueche_Interesse_Kochen_Button_Clicked")
BTC.Hide("GO.HANDMENU.Option1Button")
RunTree("32_Grotto_Kueche_Kochen_Anzahl")
}
Composite(Sequence) {
// keine Antwort
BTC.Wait(5)
BTC.CompareBool("32_Grotto_Kueche_Interesse_Kochen_Button_Clicked", false)
BTC.Hide("GO.HANDMENU.Option1Button")
RunTree("32_Grotto_Kueche_Zusammen_Kochen")
}
}
@ -428,10 +512,45 @@ Tree("32_Grotto_Kueche_Interesse_Kochen") {
}
Tree("32_Grotto_Kueche_Kochen_Anzahl") {
// --- Kueche - Kochen Anzahl ---
Composite(Sequence) {
BTC.Run("AudioSource.AUDIO.Kueche1FKochenAnza")
// Frage beantworten
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()
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.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")
@ -454,11 +573,17 @@ Tree("32_Grotto_Kueche_Kochen_Anzahl") {
BTC.Hide("GO.HANDMENU.Option2Button")
RunTree("32_Grotto_Kueche_Zusammen_Kochen")
}
}
}
}
}
// -- Race 2: User sagt nichts
Composite(Sequence) {
// keine Antwort
BTC.Wait(5)
BTC.Hide("GO.HANDMENU.Option1Button")
BTC.Hide("GO.HANDMENU.Option2Button")
BTC.CompareUserSpeechInputStarted(false)
BTC.StopSpeechIntentRecognition()
BTC.ClearPossbileSpeechIntents()
RunTree("32_Grotto_Kueche_Zusammen_Kochen")
}
}
@ -466,6 +591,7 @@ Tree("32_Grotto_Kueche_Kochen_Anzahl") {
}
Tree("32_Grotto_Kueche_Zusammen_Kochen") {
// --- Kueche - Zusammen Kochen ---
Composite(Sequence) {
BTC.Run("AudioSource.AUDIO.Kueche1FZusammenKo")
@ -514,6 +640,7 @@ Tree("32_Grotto_Kueche_Zusammen_Kochen") {
}
Tree("32_Grotto_Kueche_Selbststaendig_Kochen") {
// --- Kueche - Selbststaendig Kochen ---
Composite(Sequence) {
BTC.Run("AudioSource.AUDIO.Kueche1FSelbststae")
// Selbstaendig kochen...
@ -524,6 +651,7 @@ Tree("32_Grotto_Kueche_Selbststaendig_Kochen") {
}
Tree("32_Grotto_Kueche_Parmigiano") {
// --- Kueche - Parmigiano ---
Composite(Sequence) {
BTC.Run("AudioSource.AUDIO.Kueche4FZusammenKo")
@ -557,18 +685,48 @@ Tree("32_Grotto_Kueche_Parmigiano") {
BTC.Run("AudioSource.AUDIO.Kueche5FZusammenKo")
BTC.Run("AudioSource.AUDIO.Kueche6FZusammenKo")
// --- Outro ---
// --- Kueche - Outro ---
BTC.Run("AudioSource.AUDIO.Kueche1GOutro")
BTC.Run("AudioSource.AUDIO.Kueche2GOutro")
// Name sagen
BTC.AddPossbileSpeechIntent("Kueche.Outro.4", "Mein Name ist xy.")
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()
// Fallback Button
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")
}
}
}
// -- Race 2: User sagt nichts
Composite(Sequence) {
BTC.Wait(5)
BTC.CompareUserSpeechInputStarted(false)
BTC.StopSpeechIntentRecognition()
BTC.ClearPossbileSpeechIntents()
}
}
BTC.Run("AudioSource.AUDIO.Kueche3GOutro")
}
}

File diff suppressed because it is too large Load Diff

View File

@ -140,9 +140,6 @@ PlayerSettings:
bundleVersion: 0.1
preloadedAssets:
- {fileID: 11400000, guid: be340e3c48769439d8d18a5a2bccd498, type: 2}
- {fileID: 11400000, guid: bfa1182bd221b4ca89619141f66f1260, type: 2}
- {fileID: -8196854396901781169, guid: 1a4c68ca72a83449f938d669337cb305, type: 2}
- {fileID: -64324148185763206, guid: a9a6963505ddf7f4d886008c6dc86122, type: 2}
metroInputSource: 0
wsaTransparentSwapchain: 0
m_HolographicPauseOnTrackingLoss: 1