Ich arbeite derzeit am Dialogsystem in Godot 4 mit Dialog Manager 3. Ich habe eine Funktion "CheckDialogueFineished" erstellt, um zu überprüfen, ob das Dialogereignis bereits zu Ende gegangen ist. Es soll in der Funktion "checkInteract" abonniert werden, aber es tut es nie. Jede Hilfe wird geschätzt, Tyia! < /P>
using Godot;
using System;
using DialogueManagerRuntime;
public partial class ObjectInteract : Node {
private Resource dialogue = GD.Load("res://Dialogue/Test.dialogue");
private bool isInDialogue = false;
/*
Function Desc: Gets the distance between an object and the player via slope
@param ObjectX -> x-coordinate of the Object
@param ObjectY -> y-coordinate of the Object
@param PlayerX -> x-coordinate of the Player
@param PlayerY -> y-coordinate of the Player
*/
public float getDistanceSlope(float ObjectX, float ObjectY, float PlayerX, float PlayerY){
float dx = ObjectX - PlayerX;
float dy = ObjectY - PlayerY;
float distance = dx * dx + dy * dy;
float trueDistance = (float)Math.Sqrt(distance);
return distance;
}
/*
Function Desc: Checks whether the player is close enough to interact with the object
@param slope -> Distance between object and player
@param objectName -> Name of the object
*/
public void checkInteract(float slope){
if (slope < 850 && Input.IsActionJustPressed("interact") && !isInDialogue){
DialogueManager.ShowExampleDialogueBalloon(dialogue);
isInDialogue = true;
DialogueManager.DialogueEnded += checkDialogueFinished;
GD.Print("Event fired!");
}
}
private void checkDialogueFinished(Resource dialogue) {
GD.Print("Event ended, setting isInDialogue back to false!");
isInDialogue = false;
DialogueManager.DialogueEnded -= checkDialogueFinished;
}
}
Ich habe versucht, die Dialoguemanagruntime zu überprüfen, aber noch keine Lösung gefunden.
Ich arbeite derzeit am Dialogsystem in Godot 4 mit Dialog Manager 3. Ich habe eine Funktion "CheckDialogueFineished" erstellt, um zu überprüfen, ob das Dialogereignis bereits zu Ende gegangen ist. Es soll in der Funktion "checkInteract" abonniert werden, aber es tut es nie. Jede Hilfe wird geschätzt, Tyia! < /P> [code]using Godot; using System; using DialogueManagerRuntime;
public partial class ObjectInteract : Node { private Resource dialogue = GD.Load("res://Dialogue/Test.dialogue"); private bool isInDialogue = false;
/* Function Desc: Gets the distance between an object and the player via slope @param ObjectX -> x-coordinate of the Object @param ObjectY -> y-coordinate of the Object @param PlayerX -> x-coordinate of the Player @param PlayerY -> y-coordinate of the Player */ public float getDistanceSlope(float ObjectX, float ObjectY, float PlayerX, float PlayerY){ float dx = ObjectX - PlayerX; float dy = ObjectY - PlayerY; float distance = dx * dx + dy * dy; float trueDistance = (float)Math.Sqrt(distance);
return distance; } /* Function Desc: Checks whether the player is close enough to interact with the object @param slope -> Distance between object and player @param objectName -> Name of the object */ public void checkInteract(float slope){ if (slope < 850 && Input.IsActionJustPressed("interact") && !isInDialogue){ DialogueManager.ShowExampleDialogueBalloon(dialogue); isInDialogue = true;
Im Grunde versuche ich, C# und Godot zu lernen, indem ich einem Tutorial folge. Während des Abschnitts, in dem Sie den Player codieren, muss eine exportierte Variable (Geschwindigkeit) im Inspektor...
Ich stelle einen Fußball-/Fußball -Match -Engine in Godot 4.3 als Lernübung zusammen und bin auf ein Problem gestoßen, um einen Ball zu frieren/den Ball an einen der Spieler zu befestigen. Hier ist,...
Ich versuche, einen Pokemon -Gameboy -wie -Grid -Basis -Bewegung in Godot zu kreieren, aber die Bewegung ist abgehackt, es fühlt sich seltsam an, als wenn sich der Charakter nach einem Fliese bewegt,...
Ich stehe vor einem Problem, bei dem eine ComboBox in einem UserControl ihren ausgewählten Wert nicht aktualisiert, wenn im Dropdown-Menü auf ein Element geklickt wird. Das...