BT Script Zwischenversion
parent
363812947a
commit
e307804713
|
@ -0,0 +1,254 @@
|
|||
Tree("Root") {
|
||||
Composite(Sequence) {
|
||||
BTC.InitializeSpeechManager()
|
||||
// BTC.Wait(30) oder Button Klick
|
||||
BTC.SynthesizeText("Wir beiden werden jetzt ein feines Risotto nach dem Rezept meiner Nonna kochen. Kochst du denn gerne?", "de-DE", "")
|
||||
BTC.SpeechOutputEnded()
|
||||
|
||||
// Frage beantworten
|
||||
BTC.AddPossbileSpeechIntent("Kueche.alles_gefunden.4", "Ja., Ja, ich koche gerne., Ich koche gerne., Ich liebe es zu kochen., Ja, sehr gerne.")
|
||||
BTC.AddPossbileSpeechIntent("Kueche.alles_gefunden.6", "Nein., Nein, ich koche nicht gerne., Ich mag Kochen nicht., Nein, gar nicht.")
|
||||
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_Desinteresse_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")
|
||||
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")
|
||||
BTC.Hide("GO.HANDMENU.Option1Button")
|
||||
BTC.Hide("GO.HANDMENU.Option2Button")
|
||||
RunTree("32_Grotto_Kueche_Desinteresse_Kochen")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// -- Race 2: User sagt nichts
|
||||
Composite(Sequence) {
|
||||
BTC.Wait(10)
|
||||
BTC.CompareUserSpeechInputStarted(false)
|
||||
BTC.AbortSpeechEventListener()
|
||||
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")
|
||||
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")
|
||||
BTC.Hide("GO.HANDMENU.Option1Button")
|
||||
BTC.Hide("GO.HANDMENU.Option2Button")
|
||||
RunTree("32_Grotto_Kueche_Desinteresse_Kochen")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Tree("32_Grotto_Kueche_Interesse_Kochen") {
|
||||
// --- Kueche - Interesse Kochen ---
|
||||
Composite(Sequence) {
|
||||
BTC.SynthesizeText("Was kochst du denn manchmal so?", "de-DE", "")
|
||||
BTC.SpeechOutputEnded()
|
||||
|
||||
// Frage beantworten
|
||||
BTC.AddPossbileSpeechIntent("Kueche.Interesse_Kochen.2", "Ich koche gerne xy., Ich mache gerne 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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// -- Race 2: User sagt nichts
|
||||
Composite(Sequence) {
|
||||
BTC.Wait(10)
|
||||
BTC.CompareUserSpeechInputStarted(false)
|
||||
BTC.AbortSpeechEventListener()
|
||||
BTC.StopSpeechIntentRecognition()
|
||||
BTC.ClearPossbileSpeechIntents()
|
||||
}
|
||||
}
|
||||
|
||||
RunTree("32_Grotto_Kueche_Kochen_Anzahl")
|
||||
}
|
||||
}
|
||||
|
||||
Tree("32_Grotto_Kueche_Kochen_Anzahl") {
|
||||
// --- Kueche - Kochen Anzahl ---
|
||||
Composite(Sequence) {
|
||||
BTC.SynthesizeText("Ja, das mag ich auch gerne. Wie oft kochst du denn so?", "de-DE", "")
|
||||
BTC.SpeechOutputEnded()
|
||||
|
||||
// Frage beantworten
|
||||
BTC.AddPossbileSpeechIntent("Kueche.Kochen_Anzahl.2", "Sehr oft., Fast täglich., Jeden Tag., Nur am Wochenende., Unter der Woche.")
|
||||
BTC.AddPossbileSpeechIntent("Kueche.Kochen_Anzahl.4", "Fast nie., Selten.")
|
||||
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(10)
|
||||
BTC.CompareUserSpeechInputStarted(false)
|
||||
BTC.AbortSpeechEventListener()
|
||||
BTC.StopSpeechIntentRecognition()
|
||||
BTC.ClearPossbileSpeechIntents()
|
||||
}
|
||||
}
|
||||
|
||||
RunTree("32_Grotto_Kueche_Interaktion")
|
||||
}
|
||||
}
|
||||
|
||||
Tree("32_Grotto_Kueche_Desinteresse_Kochen") {
|
||||
// --- Kueche - Desinteresse Kochen ---
|
||||
Composite(Sequence) {
|
||||
BTC.SynthesizeText("Oh okay, aber heute kochen wir gemeinsam und das Risotto ist auch nicht allzu schwer. Was ist denn dein Lieblingsgericht? ", "de-DE", "")
|
||||
BTC.SpeechOutputEnded()
|
||||
|
||||
// Lieblingsgericht beantworten
|
||||
BTC.AddPossbileSpeechIntent("Kueche.Desinteresse_Kochen.2", "Ich esse gerne xy., Ich liebe xy., Ich mag xy., (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()
|
||||
BTC.ClearPossbileSpeechIntents()
|
||||
}
|
||||
|
||||
// -- Selector 2: Intent nicht erkannt
|
||||
Composite(Sequence) {
|
||||
BTC.ClearPossbileSpeechIntents()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// -- Race 2: User sagt nichts
|
||||
Composite(Sequence) {
|
||||
BTC.Wait(10)
|
||||
BTC.CompareUserSpeechInputStarted(false)
|
||||
BTC.AbortSpeechEventListener()
|
||||
BTC.StopSpeechIntentRecognition()
|
||||
BTC.ClearPossbileSpeechIntents()
|
||||
}
|
||||
}
|
||||
|
||||
BTC.SynthesizeText("Ja, das mag ich auch gerne.", "de-DE", "")
|
||||
BTC.SpeechOutputEnded()
|
||||
|
||||
RunTree("32_Grotto_Kueche_Interaktion")
|
||||
}
|
||||
}
|
||||
|
||||
Tree("32_Grotto_Kueche_Interaktion") {
|
||||
Composite(Sequence) {
|
||||
BTC.SynthesizeText("Gut, dann fangen wir jetzt mit dem Risotto an. Schütte bitte die Zwiebeln und den Reis in den Topf.", "de-DE", "")
|
||||
BTC.SpeechOutputEnded()
|
||||
|
||||
BTC.GetKeyDown("Return")
|
||||
|
||||
// Interaktion: Herd anmachen, Reis und Zwiebeln in Topf leeren
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 21a1d9453a43f41259b01a70620c8e60
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue