I have been working on this for a while now and I finally figured out how I can make a working dialogue box with branching properties (this is a .JSON file)
Now I want it to connect to the Main Scene of mine where a dummy character is standing still and has the Area node attached to him. I must add that it is the 3D world / scene. I know that the Area node is able to send a signal to the code where it can say if a Body has entered or left.
I want the code to do following:
- Stop the movement of the character when interacting with the Dummy Character(No further inputs of the player with the WASD Keys which can change the position of the character) this will be the case until every piece of dialogue has been read or skipped. Releasing the input block and continue the normal WASD movement.
- Input of the player is going to be "Enter" to continue the dialogue
I myself do have some code (shown below) but you can also advice me to use a whole different set of lines of code.
const PLAYERNAME = "Mairobi"
export(String) var DialogueName = ""
export(String) var DialogueText = ""
connect("bodyentered", self, "onbodyenter")
connect("bodyexited", self, "onbodyexit")
var bodies = getoverlappingbodies()
for body in bodies:
if (body.getname() == PLAYERNAME):
print(body.getname() + "interacts with" + getname())
var textbox = get_node("Area/Panel")
print(body.getname() + "entered the area")
print(body.getname() + "exited the area")
if(body.getname() == PLAYERNAME):
var textbox = getnode("../Textbox")
I am not sure if I need to make more nodes or I need to have another piece of code made.
Thanks for reading