Add Story B Bestellung in BT

This commit is contained in:
Nadine Ganz 2025-03-05 16:33:11 +01:00
parent 3ea44e476f
commit b4e5cd0204
33 changed files with 1919 additions and 119 deletions

View File

@ -412,6 +412,8 @@ Tree("32_Grotto_Story_B_Grotto_Antwort_Nonna_Kueche") {
} }
} }
// fuer Vorzeigeversion
RunTree("32_Grotto_Hide")
RunTree("32_Grotto_Kueche_Intro") RunTree("32_Grotto_Kueche_Intro")
} }
} }
@ -1367,8 +1369,6 @@ Tree("32_Grotto_Im_Grotto_Essen_Intro") {
BTC.Run("AudioSource.AUDIO.ImGrottoessen9Intr") BTC.Run("AudioSource.AUDIO.ImGrottoessen9Intr")
BTC.Run("AudioSource.AUDIO.ImGrottoessen10Int") BTC.Run("AudioSource.AUDIO.ImGrottoessen10Int")
RunTree("32_Grotto_Hide")
// --- Im Grotto Essen - Zweite Bestellung --- // --- Im Grotto Essen - Zweite Bestellung ---
BTC.Run("AudioSource.AUDIO.ImGrottoessen1Zwei") BTC.Run("AudioSource.AUDIO.ImGrottoessen1Zwei")
@ -1385,13 +1385,11 @@ Tree("32_Grotto_Im_Grotto_Essen_Intro") {
Composite(Sequence) { Composite(Sequence) {
BTC.SpeechIntentRecognized() BTC.SpeechIntentRecognized()
BTC.ClearPossbileSpeechIntents() BTC.ClearPossbileSpeechIntents()
RunTree("32_Grotto_Im_Grotto_Essen_Nachfrage_Kellner_Essen")
} }
// -- Selector 2: Intent nicht erkannt // -- Selector 2: Intent nicht erkannt
Composite(Sequence) { Composite(Sequence) {
BTC.ClearPossbileSpeechIntents() BTC.ClearPossbileSpeechIntents()
RunTree("32_Grotto_Im_Grotto_Essen_Nachfrage_Kellner_Essen")
} }
} }
} }
@ -1403,24 +1401,231 @@ Tree("32_Grotto_Im_Grotto_Essen_Intro") {
BTC.AbortSpeechEventListener() BTC.AbortSpeechEventListener()
BTC.StopSpeechIntentRecognition() BTC.StopSpeechIntentRecognition()
BTC.ClearPossbileSpeechIntents() BTC.ClearPossbileSpeechIntents()
// Fallback Button
Composite(Marathon) {
BTC.Show("GO.GO.SpeechButton")
BTC.Set("TextMeshPro.GO.Option1Button", "text", "una gazzosa")
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_Im_Grotto_Essen_Nachfrage_Kellner") { // --- Im Grotto Essen - Nachfrage Kellner Essen ---
Composite(Sequence) { BTC.Run("AudioSource.AUDIO.ImGrottoessen1Esse")
BTC.GetKeyDown("Return")
BTC.SetBool("drink_ordered", false) BTC.AddPossbileSpeechIntent("Im_Grotto_essen.Nachfrage_Kellner_Essen.2")
BTC.AddPossbileSpeechIntent("Im_Grotto_essen.Nachfrage_Kellner_Essen.3")
BTC.AddPossbileSpeechIntent("Im_Grotto_essen.Nachfrage_Kellner_Essen.4")
BTC.StartSpeechIntentRecognition()
Composite(Race) { Composite(Race) {
BTC.CompareBool("drink_ordered") // -- Race 1: User sagt etwas
Decorator(Repeat) {
Composite(Sequence) { Composite(Sequence) {
BTC.Run("AudioSource.AUDIO.ImGrottoessen1Nach") BTC.UserStartedSpeechInput()
BTC.AddPossbileSpeechIntent("Im_Grotto_essen.Zweite_Bestellung.2") Composite(Selector) {
// -- Selector 1: Intent erkannt
Composite(Sequence) {
BTC.SpeechIntentRecognized()
// Intent erkannt
Composite(Race) {
Composite(Sequence) {
BTC.CompareIntentID("Im_Grotto_essen.Nachfrage_Kellner_Essen.2")
BTC.ClearPossbileSpeechIntents()
BTC.SetBool("ChoosedRisotto")
}
Composite(Sequence) {
BTC.CompareIntentID("Im_Grotto_essen.Nachfrage_Kellner_Essen.3")
BTC.ClearPossbileSpeechIntents()
BTC.SetBool("ChoosedPizochen")
}
Composite(Sequence) {
BTC.CompareIntentID("Im_Grotto_essen.Nachfrage_Kellner_Essen.4")
BTC.ClearPossbileSpeechIntents()
BTC.SetBool("ChoosedInsalata")
}
}
}
// -- Selector 2: Intent nicht erkannt
Composite(Sequence) {
// --- Im Grotto Essen - Nachfrage Kellner Unklar ---
// SpeechIntentRecognized Failed: kein Intent erkannt
BTC.SynthesizeText("Perdonami, non ho capito bene, cosa desideri?")
BTC.SpeechOutputEnded()
BTC.StartSpeechIntentRecognition()
Composite(Race) {
Composite(Sequence) {
BTC.UserStartedSpeechInput()
BTC.SpeechIntentRecognized()
Composite(Race) {
Composite(Sequence) {
BTC.CompareIntentID("Im_Grotto_essen.Nachfrage_Kellner_Essen.2")
BTC.ClearPossbileSpeechIntents()
BTC.SetBool("ChoosedRisotto")
}
Composite(Sequence) {
BTC.CompareIntentID("Im_Grotto_essen.Nachfrage_Kellner_Essen.3")
BTC.ClearPossbileSpeechIntents()
BTC.SetBool("ChoosedPizochen")
}
Composite(Sequence) {
BTC.CompareIntentID("Im_Grotto_essen.Nachfrage_Kellner_Essen.4")
BTC.ClearPossbileSpeechIntents()
BTC.SetBool("ChoosedInsalata")
}
}
}
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", "Risotto")
BTC.Show("GO.GO.Option1Button")
BTC.Set("TextMeshPro.GO.Option2Button", "text", "Pizochen")
BTC.Show("GO.GO.Option2Button")
BTC.Set("TextMeshPro.GO.Option3Button", "text", "Insalata")
BTC.Show("GO.GO.Option3Button")
}
Composite(Race) {
Composite(Sequence) {
// Risotto
BTC.Run("NamedEventTrigger.GO.Option1Button")
BTC.AbortEventListener("NamedEventTrigger.GO.Option2Button")
BTC.AbortEventListener("NamedEventTrigger.GO.Option3Button")
BTC.Hide("GO.GO.Option1Button")
BTC.Hide("GO.GO.Option2Button")
BTC.Hide("GO.GO.Option3Button")
BTC.Hide("GO.GO.SpeechButton")
BTC.Show("GO.GO.Home")
BTC.Hide("GO.GO.SpeechOptions")
BTC.SetBool("ChoosedRisotto")
}
Composite(Sequence) {
// Pizochen
BTC.Run("NamedEventTrigger.GO.Option2Button")
BTC.AbortEventListener("NamedEventTrigger.GO.Option1Button")
BTC.AbortEventListener("NamedEventTrigger.GO.Option3Button")
BTC.Hide("GO.GO.Option1Button")
BTC.Hide("GO.GO.Option2Button")
BTC.Hide("GO.GO.Option3Button")
BTC.Hide("GO.GO.SpeechButton")
BTC.Show("GO.GO.Home")
BTC.Hide("GO.GO.SpeechOptions")
BTC.SetBool("ChoosedPizochen")
}
Composite(Sequence) {
// Insalata
BTC.Run("NamedEventTrigger.GO.Option3Button")
BTC.AbortEventListener("NamedEventTrigger.GO.Option1Button")
BTC.AbortEventListener("NamedEventTrigger.GO.Option2Button")
BTC.Hide("GO.GO.Option1Button")
BTC.Hide("GO.GO.Option2Button")
BTC.Hide("GO.GO.Option3Button")
BTC.Hide("GO.GO.SpeechButton")
BTC.Show("GO.GO.Home")
BTC.Hide("GO.GO.SpeechOptions")
BTC.SetBool("ChoosedInsalata")
}
}
}
}
}
// -- Race 2: User sagt nichts
Composite(Sequence) {
BTC.Wait(5)
BTC.CompareUserSpeechInputStarted(false)
BTC.AbortSpeechEventListener()
BTC.StopSpeechIntentRecognition()
BTC.ClearPossbileSpeechIntents()
// Fallback Button
Composite(Sequence) {
Composite(Marathon) {
BTC.Show("GO.GO.SpeechButton")
BTC.Set("TextMeshPro.GO.Option1Button", "text", "Risotto")
BTC.Show("GO.GO.Option1Button")
BTC.Set("TextMeshPro.GO.Option2Button", "text", "Pizochen")
BTC.Show("GO.GO.Option2Button")
BTC.Set("TextMeshPro.GO.Option3Button", "text", "Insalata")
BTC.Show("GO.GO.Option3Button")
}
Composite(Race) {
Composite(Sequence) {
// Risotto
BTC.Run("NamedEventTrigger.GO.Option1Button")
BTC.AbortEventListener("NamedEventTrigger.GO.Option2Button")
BTC.AbortEventListener("NamedEventTrigger.GO.Option3Button")
BTC.Hide("GO.GO.Option1Button")
BTC.Hide("GO.GO.Option2Button")
BTC.Hide("GO.GO.Option3Button")
BTC.Hide("GO.GO.SpeechButton")
BTC.Show("GO.GO.Home")
BTC.Hide("GO.GO.SpeechOptions")
BTC.SetBool("ChoosedRisotto")
}
Composite(Sequence) {
// Pizochen
BTC.Run("NamedEventTrigger.GO.Option2Button")
BTC.AbortEventListener("NamedEventTrigger.GO.Option1Button")
BTC.AbortEventListener("NamedEventTrigger.GO.Option3Button")
BTC.Hide("GO.GO.Option1Button")
BTC.Hide("GO.GO.Option2Button")
BTC.Hide("GO.GO.Option3Button")
BTC.Hide("GO.GO.SpeechButton")
BTC.Show("GO.GO.Home")
BTC.Hide("GO.GO.SpeechOptions")
BTC.SetBool("ChoosedPizochen")
}
Composite(Sequence) {
// Insalata
BTC.Run("NamedEventTrigger.GO.Option3Button")
BTC.AbortEventListener("NamedEventTrigger.GO.Option1Button")
BTC.AbortEventListener("NamedEventTrigger.GO.Option2Button")
BTC.Hide("GO.GO.Option1Button")
BTC.Hide("GO.GO.Option2Button")
BTC.Hide("GO.GO.Option3Button")
BTC.Hide("GO.GO.SpeechButton")
BTC.Show("GO.GO.Home")
BTC.Hide("GO.GO.SpeechOptions")
BTC.SetBool("ChoosedInsalata")
}
}
}
}
}
BTC.Run("AudioSource.AUDIO.ImGrottoessen3Nach")
BTC.Wait(10)
BTC.Run("AudioSource.AUDIO.ImGrottoessen4Nach")
BTC.AddPossbileSpeechIntent("Im_Grotto_essen.Nachfrage_Kellner_unklar.5")
BTC.StartSpeechIntentRecognition() BTC.StartSpeechIntentRecognition()
Composite(Race) { Composite(Race) {
@ -1433,13 +1638,11 @@ Tree("32_Grotto_Im_Grotto_Essen_Nachfrage_Kellner") {
Composite(Sequence) { Composite(Sequence) {
BTC.SpeechIntentRecognized() BTC.SpeechIntentRecognized()
BTC.ClearPossbileSpeechIntents() BTC.ClearPossbileSpeechIntents()
RunTree("32_Grotto_Im_Grotto_Essen_Nachfrage_Kellner_Essen")
} }
// -- Selector 2: Intent nicht erkannt // -- Selector 2: Intent nicht erkannt
Composite(Sequence) { Composite(Sequence) {
BTC.ClearPossbileSpeechIntents() BTC.ClearPossbileSpeechIntents()
RunTree("32_Grotto_Im_Grotto_Essen_Nachfrage_Kellner_Essen")
} }
} }
} }
@ -1453,16 +1656,84 @@ Tree("32_Grotto_Im_Grotto_Essen_Nachfrage_Kellner") {
BTC.ClearPossbileSpeechIntents() BTC.ClearPossbileSpeechIntents()
} }
} }
}
}
}
}
} // Getränke ersetzen fuer User
BTC.Run("AudioSource.AUDIO.ImGrottoessen9Nach")
BTC.Run("AudioSource.AUDIO.ImGrottoessen10Nac")
Tree("32_Grotto_Im_Grotto_Essen_Nachfrage_Kellner_Essen") { BTC.AddPossbileSpeechIntent("Im_Grotto_essen.Nachfrage_Kellner_unklar.11")
BTC.StartSpeechIntentRecognition()
Composite(Race) {
// -- Race 1: User sagt etwas
Composite(Sequence) { Composite(Sequence) {
BTC.Run("AudioSource.AUDIO.ImGrottoessen1Esse") 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()
}
}
BTC.Run("AudioSource.AUDIO.ImGrottoessen15Nac")
BTC.Run("AudioSource.AUDIO.ImGrottoessen16Nac")
BTC.Run("AudioSource.AUDIO.ImGrottoessen18Nac")
BTC.Run("AudioSource.AUDIO.ImGrottoessen22Nac")
BTC.Run("AudioSource.AUDIO.ImGrottoessen23Nac")
BTC.AddPossbileSpeechIntent("Im_Grotto_essen.Nachfrage_Kellner_unklar.24")
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()
}
}
// --- Im Grotto Essen - Outro ---
// ...
RunTree("32_Grotto_Hide") RunTree("32_Grotto_Hide")
} }

File diff suppressed because it is too large Load Diff

View File

@ -81,7 +81,7 @@ public class PhotoTransition : MonoBehaviour
IEnumerator ImageLoader(string path) IEnumerator ImageLoader(string path)
{ {
string imgPath = Path.Combine(Application.streamingAssetsPath, path); string imgPath = Path.Combine(Application.persistentDataPath, path);
//imgPath = "file://" + imgPath; // For testing in editor //imgPath = "file://" + imgPath; // For testing in editor
using (UnityWebRequest uwr = UnityWebRequestTexture.GetTexture(imgPath)) using (UnityWebRequest uwr = UnityWebRequestTexture.GetTexture(imgPath))

View File

@ -230,10 +230,25 @@
{ {
"intentID": "Im_Grotto_essen.Nachfrage_Kellner_Essen.2", "intentID": "Im_Grotto_essen.Nachfrage_Kellner_Essen.2",
"intentSentences": [ "intentSentences": [
"Io vorrei xy.",
"Prendo il risotto.", "Prendo il risotto.",
"Risotto.",
"Io vorrei un risotto."
]
},
{
"intentID": "Im_Grotto_essen.Nachfrage_Kellner_Essen.3",
"intentSentences": [
"Prendo i pizochen.", "Prendo i pizochen.",
"Prendo un'insalata." "Pizochen.",
"Io vorrei una pizochen."
]
},
{
"intentID": "Im_Grotto_essen.Nachfrage_Kellner_Essen.4",
"intentSentences": [
"Insalata.",
"Prendo un'insalata.",
"Io vorrei un'insalata."
] ]
}, },
{ {
@ -241,14 +256,9 @@
"intentSentences": [ "intentSentences": [
"No.", "No.",
"No, non lo so.", "No, non lo so.",
"Nessun'idea." "Nessun'idea.",
]
},
{
"intentID": "Im_Grotto_essen.Nachfrage_Kellner_unklar.6",
"intentSentences": [
"S\u00ec.", "S\u00ec.",
"S\u00ec, originariamente significava \"cantina\".", "S\u00ec, originariamente significava cantina.",
"S\u00ec, era come un frigo naturale dove consevare i generi alimentari." "S\u00ec, era come un frigo naturale dove consevare i generi alimentari."
] ]
}, },
@ -257,12 +267,7 @@
"intentSentences": [ "intentSentences": [
"S\u00ec.", "S\u00ec.",
"S\u00ec, ogni volta che andiamo in Ticino mangiamo in un grotto.", "S\u00ec, ogni volta che andiamo in Ticino mangiamo in un grotto.",
"S\u00ec, ho gi\u00e0 mangiato in un grotto." "S\u00ec, ho gi\u00e0 mangiato in un grotto.",
]
},
{
"intentID": "Im_Grotto_essen.Nachfrage_Kellner_unklar.12",
"intentSentences": [
"No.", "No.",
"No, non ho mai mangiato in un grotto. ", "No, non ho mai mangiato in un grotto. ",
"No, purtroppo no." "No, purtroppo no."

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: c4e2c37d42f614521ab25c2e722b8c18
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 MiB

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: be1106f0c2add453d93a76eb15c5e86f
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 MiB

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 30757dc81dd964d269beda18a3f63003
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 MiB

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: e438032979ef740508c32bd4e4304788
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 MiB

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 6151f6d8480154c7895ec28ded2c68c0
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 MiB

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 698877680d23e46d58fd7d678938f7a0
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: