RPG Dialogue?
Hi, I am making a 2D RPG, and I was wondering if anyone has a full-length script, or could make one for me, of dialogue somewhat like this:
https://www.youtube.com/watch?v=ncr8pWRpqo8
You can press X To skip the typing of the dialogue, and press Z to go to the next dialogue box. And Audio that you can choose, including the image.
And Sometimes you can choose a choice someone asks you, like this:
https://youtu.be/Q8W5sEOjGD8?t=207
And that would effect what the person says.
Any help would be very appreciated.
These videos are from the RPG game, Undertale, by the way, for any Undertale fans :)
Answer by Bluestone19 · Jul 13, 2016 at 01:15 PM
I've made a dialog system in Visual Basic for a school project (which I've been meaning to re-create in unity), but here are the basics: 1. You need the dialog box UI (Probably just an image and text over it) 2. A static "Is Talking" variable to prevent the player from moving during text 3. a variable to hold the text (static too) 4. a custom function for starting/stopping dialog, which if the dialog doesn't have a "next" set of text, it hides the box and sets "Is Talking" to false. 5. (EDIT) you also should make it so if it's loading the same dialog, it advances in the dialog. You'll also need "dialog" and "Box" variables, both static as well.
If you would like me to try and roughly port over my game's code into C#, I can do that, although no guarantees it will intermesh into your game perfectly without manipulation. I recommend building it unique to your game because then you'll understand (for the most part) what each part does and how to modify it and fix it later, as well as the good learning benefit.
@Bluestone19 What I meant was sure, i'll see the script, even if there is mess-ups, I will fix them.
Do you mean the VB script or a ported one? I don't have a unity-ready version, although I can make quick adjustments to the vb one to make it usable if modified.
Nessecary variables:
Declare these!
Talk - Bool
TextOpt - Bool
LargeOpt - Bool
$$anonymous$$axOpt - Byte
SelectedOpt - Byte
Box - Byte
TalkingTarget - Byte
Text - String
Restart - Bool
if (Restart) { //If restarting
Box = 0; //put the box to 0
};
DialogBox.Visible = True; //Shows the box (YOU WILL PROBABLY HAVE TO CHANGE)
if (Talk = False Or Dialog <> CurrentDialog) { //If not continuing a dialog
Talk = True; //Then start one
Box = 0; //from the beginning
CurrentDialog = Dialog; //and record what dialog is being started
} ElseIf (Restart = False) { //Otherwise (if continuing)
Box += 1 //Progress a box
};
if (TextOpt = False) { //If it's not a choice,
OptionBox.Visible = False; //Don't show the options.
};
//. . . Code to put the correct text into the “text” variable . . .
//I don’t know how you want to do this, maybe from text resource file or a select case?
//You mentioned audio. That would probably have to be controlled in this chunk too then, as well as anything that may change on a box-by-box basis.
DialogBox.Text = Text; //Display the text!
if (Talk = False) { //If no longer talking,
txtDialog.Visible = False; //close the box
};
if (TextOpt = False) { //If there isn't a choice,
txtOption.Visible = False; //Don't show the options
};
This is some very rough code, that will in all likelihood won't work without some kind of tinkering. Hope this is somewhat what you're looking for, at least a sort of "skeleton" or framework for what you're looking for.
Answer by BlockFade · Feb 06, 2017 at 05:42 PM
Im making a undertale battle engine for unity play it here: https://gamejolt.com/games/undertale-unity-battle-engine-demo/230707 I also have a unity asset pending review called TypeUnity!, it will have all of the features you require, including the ability to skip text(like undertale) and the ability to change which key to skip. VIdeos of Undertale Battle Engine for Unity: https://www.youtube.com/watch?v=oe7heAing2I
https://www.youtube.com/watch?v=mX4ADEpp0AA I'll post the link to the asset here when it's done.
That is awesome @CreptthrustGames , I will wait for the asset to come out! I appreciate you for making this; I will definitely sub to your channel!
Best Regards, Ejpj123
Your answer
Follow this Question
Related Questions
2D player hides behind the room setting 2 Answers
Change Scenes Like Minit 1 Answer
How to fix the rotation bug? 1 Answer
8 direction movement with mouse 0 Answers