Bug Fixing in grotto kitchen scene

dev
Nadine Ganz 2024-09-24 17:33:08 +02:00
parent 2c3f796138
commit 1ec43f1676
7 changed files with 426393 additions and 35 deletions

View File

@ -1,8 +1,8 @@
Tree("Root") { Tree("Root") {
Composite(Sequence) { Composite(Sequence) {
BTC.InitializeSpeechManager() BTC.InitializeSpeechManager()
//RunTree("32_Grotto_Kueche_Intro") RunTree("32_Grotto_Kueche_Intro")
//RunTree("32_Grotto_Kueche_Zwiebeln_schneiden") RunTree("32_Grotto_Kueche_Zwiebeln_schneiden")
RunTree("32_Grotto_Kueche_alles_gefunden") RunTree("32_Grotto_Kueche_alles_gefunden")
//RunTree("32_Grotto_Kueche_Kochen_Anzahl") //RunTree("32_Grotto_Kueche_Kochen_Anzahl")
//RunTree("32_Grotto_Kueche_Zusammen_Kochen") //RunTree("32_Grotto_Kueche_Zusammen_Kochen")
@ -213,7 +213,10 @@ Tree("32_Grotto_Kueche_Intro") {
//BTC.GetKeyDown("Return") //BTC.GetKeyDown("Return")
BTC.Run("GO/NamedGrabEvent.INTERACTABLES.Schuerze") BTC.Run("GO/NamedGrabEvent.INTERACTABLES.Schuerze")
BTC.Hide("GO/NamedGrabEvent.INTERACTABLES.Schuerze") BTC.Hide("GO/NamedGrabEvent.INTERACTABLES.Schuerze")
BTC.Run("AudioSource.AUDIO.Kueche2FIntro")
//BTC.Run("AudioSource.AUDIO.Kueche2FIntro")
BTC.SynthesizeText("Lies mir bitte das Rezept vor.", "de-DE", "")
BTC.SpeechOutputEnded()
// Rezept vorlesen: Button Klick // Rezept vorlesen: Button Klick
BTC.Set("TextMeshPro.HANDMENU.Option1Button", "text", "Rezept vorlesen") BTC.Set("TextMeshPro.HANDMENU.Option1Button", "text", "Rezept vorlesen")
@ -228,7 +231,8 @@ Tree("32_Grotto_Kueche_Intro") {
Composite(Sequence) { Composite(Sequence) {
// keine Reaktion // keine Reaktion
BTC.Wait(5) BTC.Wait(5)
// BTC.Run(Audio) BTC.SynthesizeText("Was brauchen wir? Bitte lies mir das Rezept vor.", "de-DE", "")
BTC.SpeechOutputEnded()
BTC.Run("NamedEventTrigger.HANDMENU.Option1Button") BTC.Run("NamedEventTrigger.HANDMENU.Option1Button")
} }
} }
@ -301,31 +305,32 @@ Tree("32_Grotto_Kueche_Zwiebeln_schneiden") {
Composite(Sequence) { Composite(Sequence) {
// Success // Success
BTC.Run("GO/NamedSocketEvent.SOCKETS.RisottoSocket") BTC.Run("GO/NamedSocketEvent.SOCKETS.RisottoSocket")
//BTC.GetKeyDown("Return")
BTC.SetBool("RisottoIsSnapped")
BTC.Disable("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Risotto") BTC.Disable("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Risotto")
BTC.SetBool("IsSnapped")
} }
Composite(Sequence) { Composite(Sequence) {
// Fail // Fail
BTC.Run("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Risotto") //BTC.GetKeyDown("Space")
BTC.ListenToEvent("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Risotto")
BTC.CompareBool("RisottoIsSnapped", false)
Composite(Marathon) { // Objekt geht zurueck
BTC.Run("AudioSource.AUDIO.Kueche2FZwiebelnsc") BTC.SetPosition("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Risotto", -6.733, 1.362, -18.908)
// Objekt geht zurueck
BTC.SetPosition("GO/NamedGrabEvent/NamedOutline.INTERACTABLES.Risotto", -6.733, 1.362, -18.908)
}
BTC.SetBool("IsSnapped", false) BTC.SynthesizeText("Das hast du an den falschen Ort gestellt.", "de-DE", "")
BTC.SpeechOutputEnded()
BTC.SetBool("RisottoIsSnapped", false)
} }
} }
BTC.CompareBool("IsSnapped") BTC.CompareBool("RisottoIsSnapped")
} // Sequence } // Sequence
} }
} // Repeat } // Repeat
Composite(Sequence) { Composite(Sequence) {
BTC.Run("NamedGrabEvent/NamedOutline.INTERACTABLES.Salz") BTC.Run("NamedGrabEvent/NamedOutline.INTERACTABLES.Salz")
BTC.Disable("NamedGrabEvent/NamedOutline.INTERACTABLES.Salz") BTC.Disable("NamedGrabEvent/NamedOutline.INTERACTABLES.Salz")
BTC.Run("GO/NamedSocketEvent.SOCKETS.SalzSocket") BTC.Run("GO/NamedSocketEvent.SOCKETS.SalzSocket")
@ -356,6 +361,7 @@ Tree("32_Grotto_Kueche_Zwiebeln_schneiden") {
} }
} }
BTC.SetBool("RisottoIsSnapped", false)
BTC.Wait(1) BTC.Wait(1)
Composite(Marathon) { Composite(Marathon) {
@ -511,6 +517,7 @@ Tree("32_Grotto_Kueche_Interesse_Kochen") {
// keine Antwort // keine Antwort
BTC.Wait(5) BTC.Wait(5)
BTC.CompareBool("32_Grotto_Kueche_Interesse_Kochen_Button_Clicked", false) BTC.CompareBool("32_Grotto_Kueche_Interesse_Kochen_Button_Clicked", false)
BTC.AbortEventListener("NamedEventTrigger.HANDMENU.Option1Button")
BTC.Hide("GO.HANDMENU.Option1Button") BTC.Hide("GO.HANDMENU.Option1Button")
RunTree("32_Grotto_Kueche_Zusammen_Kochen") RunTree("32_Grotto_Kueche_Zusammen_Kochen")
} }
@ -663,16 +670,19 @@ Tree("32_Grotto_Kueche_Selbststaendig_Kochen") {
Tree("32_Grotto_Kueche_Parmigiano") { Tree("32_Grotto_Kueche_Parmigiano") {
// --- Kueche - Parmigiano --- // --- Kueche - Parmigiano ---
Composite(Sequence) { Composite(Sequence) {
BTC.Run("AudioSource.AUDIO.Kueche4FZusammenKo") 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 // Parmigiano in Topf geben
BTC.Run("NamedGrabEvent.INTERACTABLES.Parmigiano") BTC.Run("NamedGrabEvent.INTERACTABLES.Parmigiano")
BTC.Set("Collider.INTERACTABLES.Topf", "otherTag", "Parmigiano") BTC.Set("Collider.INTERACTABLES.Topf", "otherTag", "Parmigiano")
BTC.Run("Collider.INTERACTABLES.Topf") BTC.Run("Collider.INTERACTABLES.Topf")
BTC.Run("AudioSource.AUDIO.Kueche4FZusammenKo") // Richtige Audio fehlt BTC.SynthesizeText("Bist du fertig?", "de-DE", "")
BTC.SpeechOutputEnded()
// Antwort User // Antwort User
// ToDo: Sprache fehlt
BTC.Set("TextMeshPro.HANDMENU.Option1Button", "text", "Ja") BTC.Set("TextMeshPro.HANDMENU.Option1Button", "text", "Ja")
BTC.Show("GO.HANDMENU.Option1Button") BTC.Show("GO.HANDMENU.Option1Button")
Composite(Race) { Composite(Race) {
@ -681,7 +691,8 @@ Tree("32_Grotto_Kueche_Parmigiano") {
} }
BTC.Hide("GO.HANDMENU.Option1Button") BTC.Hide("GO.HANDMENU.Option1Button")
BTC.Run("AudioSource.AUDIO.Kueche4FZusammenKo") // Richtige Audio fehlt BTC.SynthesizeText("Bitte stelle den Risotto hier hin.", "de-DE", "")
BTC.SpeechOutputEnded()
// Stelle für Pfanne leuchtet // Stelle für Pfanne leuchtet
BTC.Enable("Collider/NamedOutline.INTERACTABLES.TopfUntersetzer") BTC.Enable("Collider/NamedOutline.INTERACTABLES.TopfUntersetzer")
@ -691,16 +702,18 @@ Tree("32_Grotto_Kueche_Parmigiano") {
BTC.Set("Collider/NamedOutline.INTERACTABLES.TopfUntersetzer", "otherTag", "Topf") BTC.Set("Collider/NamedOutline.INTERACTABLES.TopfUntersetzer", "otherTag", "Topf")
BTC.Run("Collider/NamedOutline.INTERACTABLES.TopfUntersetzer") BTC.Run("Collider/NamedOutline.INTERACTABLES.TopfUntersetzer")
BTC.Disable("Collider/NamedOutline.INTERACTABLES.TopfUntersetzer") BTC.Disable("Collider/NamedOutline.INTERACTABLES.TopfUntersetzer")
// ToDo: Fallback Keine Reaktion
BTC.Run("AudioSource.AUDIO.Kueche5FZusammenKo") BTC.Run("AudioSource.AUDIO.Kueche5FZusammenKo")
BTC.Run("AudioSource.AUDIO.Kueche6FZusammenKo") BTC.Run("AudioSource.AUDIO.Kueche6FZusammenKo")
// --- Kueche - Outro --- // --- Kueche - Outro ---
BTC.Run("AudioSource.AUDIO.Kueche1GOutro") BTC.Run("AudioSource.AUDIO.Kueche1GOutro")
BTC.Run("AudioSource.AUDIO.Kueche2GOutro") BTC.SynthesizeText("Ich bin Giuseppe, Francescas Grossonkel. Und wer bist du?", "de-DE", "")
BTC.SpeechOutputEnded()
// Name sagen // Name sagen
BTC.AddPossbileSpeechIntent("Kueche.Outro.4", "Mein Name ist xy.") BTC.AddPossbileSpeechIntent("Kueche.Outro.4", "Mein Name ist xy. (oder andere Antwort)")
BTC.StartSpeechIntentRecognition() BTC.StartSpeechIntentRecognition()
Composite(Race) { Composite(Race) {
@ -739,6 +752,7 @@ Tree("32_Grotto_Kueche_Parmigiano") {
} }
BTC.Run("AudioSource.AUDIO.Kueche3GOutro") BTC.Run("AudioSource.AUDIO.Kueche3GOutro")
BTC.Run("AudioSource.AUDIO.Kueche2GOutro")
} }
} }

View File

@ -264,6 +264,18 @@ public class BTC : MonoBehaviour {
Task.SetSucceeded(); Task.SetSucceeded();
} }
} }
[Task]
public void ListenToEvent(string objectName)
{
List<ComponentHandler> handlers = GetHandlers(objectName);
handlers.ForEach(handler => handler.ListenToEvent(Task.getState));
if (handlers.Count == 0)
{
Debug.LogWarning($"BTC.ListenToEvent: no components under the name '{objectName}'");
Task.SetSucceeded();
}
}
#endregion #endregion
#region video & sound tasks #region video & sound tasks

View File

@ -186,7 +186,6 @@ public class ComponentHandler : MonoBehaviour {
{ {
Debug.LogWarning($"ComponentHandler.Enable: not implemented for {this.GetType()}"); Debug.LogWarning($"ComponentHandler.Enable: not implemented for {this.GetType()}");
} }
Task.SetError();
} }
public virtual void Disable(MyBT.NodeState nodeState) public virtual void Disable(MyBT.NodeState nodeState)
@ -195,7 +194,6 @@ public class ComponentHandler : MonoBehaviour {
{ {
Debug.LogWarning($"ComponentHandler.Disable: not implemented for {this.GetType()}"); Debug.LogWarning($"ComponentHandler.Disable: not implemented for {this.GetType()}");
} }
Task.SetError();
} }
public virtual void SetPosition(MyBT.NodeState nodeState, float newX, float newY, float newZ) public virtual void SetPosition(MyBT.NodeState nodeState, float newX, float newY, float newZ)
@ -204,7 +202,6 @@ public class ComponentHandler : MonoBehaviour {
{ {
Debug.LogWarning($"ComponentHandler.SetPosition: not implemented for {this.GetType()}"); Debug.LogWarning($"ComponentHandler.SetPosition: not implemented for {this.GetType()}");
} }
Task.SetError();
} }
public virtual void AbortEventListener(MyBT.NodeState nodeState) public virtual void AbortEventListener(MyBT.NodeState nodeState)
@ -213,7 +210,14 @@ public class ComponentHandler : MonoBehaviour {
{ {
Debug.LogWarning($"ComponentHandler.AbortEventListener: not implemented for {this.GetType()}"); Debug.LogWarning($"ComponentHandler.AbortEventListener: not implemented for {this.GetType()}");
} }
Task.SetError(); }
public virtual void ListenToEvent(MyBT.NodeState nodeState)
{
if (Task.isDebugging)
{
Debug.LogWarning($"ComponentHandler.ListenToEvent: not implemented for {this.GetType()}");
}
} }
protected float sourceAlpha; protected float sourceAlpha;

View File

@ -74,23 +74,43 @@ public class NamedGrabEvent : ComponentHandler {
if (nodeState == NodeState.FirstRun) { if (nodeState == NodeState.FirstRun) {
// reset event trigger at start // reset event trigger at start
selectEnterTriggered = false; selectEnterTriggered = false;
selectExitTriggered = false;
} }
if (nodeState == NodeState.Aborting) { if (nodeState == NodeState.Aborting) {
selectEnterTriggered = false; selectEnterTriggered = false;
selectExitTriggered = false;
} }
if (selectEnterTriggered) { if (selectEnterTriggered) {
Task.SetSucceeded(); Debug.Log($"NamedGrabEvent: Select entered event from {gameObject.name} fired.");
return;
}
if (selectExitTriggered)
{
Task.SetSucceeded(); Task.SetSucceeded();
return; return;
} }
} }
public override void ListenToEvent(MyBT.NodeState nodeState)
{
if (nodeState == NodeState.FirstRun)
{
// reset event trigger at start
selectExitTriggered = false;
Debug.Log("Enter ListenToEvent");
}
if (nodeState == NodeState.Aborting)
{
selectExitTriggered = false;
}
if (nodeState == NodeState.Running)
{
if (selectExitTriggered)
{
Debug.Log($"NamedGrabEvent: Select exited event from {gameObject.name} fired.");
Task.SetSucceeded();
return;
}
}
}
} }

View File

@ -82,6 +82,7 @@ public class NamedSocketEvent : ComponentHandler
if (triggered) if (triggered)
{ {
Debug.Log($"NamedSocketEvent: Select entered event from {gameObject.name} fired.");
Task.SetSucceeded(); Task.SetSucceeded();
return; return;
} }

View File

@ -1 +1 @@
2024-09-23T15:03:45.7173120Z 2024-09-24T15:23:51.5884920Z

File diff suppressed because it is too large Load Diff