For those more savvy in coding, you may find that this tutorial feels like baby steps, or some portions of script are barbarically simplified or could be used more efficiently. This is the format of scripts that I felt most comfortable with and, to me, felt the most versatile.
As of right now, there is no example demo for Dangan Ronpa ready. However, the demo for DesireDriven can be found in the Projects thread.
DANGAN RONPA SCRIPT BREAKDOWN
Spoiler:DESIREDRIVEN SCRIPT BREAKDOWN
The Dangan Ronpa portion of the Visual Novel engine is more akin to traditional/stereotypical Visual Novels. A few tweaks and you could replicate almost any dating-sim from Japan. The following is a total breakdown of the most recent scripts.
The script below is everything needed to display the image shown above (sans the white circles), which is the beginning of a dialogue:Now that a basic idea of how the scripts work, I'll go over how utilize other features, such as standard dialogue lines, character sprite transitions, character name transitions (For when your character, or others, talk), implementing choices, and the eventual finishing of dialogue. I'll avoid using CODE displays to better highlight where your own information would be supplemented. All (X,Y) positions for text can be changed to fit your needs.Code: Select all
global int 1:Use; global int 2:Selected; global int 3:Choice; //Used for Choices (See below) global int 4:Option1; //Used for Choices (See below) global int 5:Option2; //Used for Choices (See below) Script "Nanami1" (Void) { SetActorState(1, "FadeOut1"); //Removes the character's overworld sprite SetPlayerProperty(0,1,4); //Removes freelook while talking to a character SetHUDSize(480, 280, TRUE); //Sets the HUD size, in this case, the exact HUD size of the original Dangan Ronpa SetFont("chiaa17"); //The character's display sprite (6) HudMessage(s:"A"; HUDMSG_FADEINOUT, 16, 0, 0.5, 0.5, 5, GetCVar("dn_transspeed"), 0); //The fading in of the character's talk-sprite, affected by the Transition Speed CVAR SetFont("dtalk1"); //The dialogue box sprite (5) HudMessage(s:"A"; HUDMSG_FADEINOUT, 14, 0, 0.5, 0.5, 5, GetCVar("dn_transspeed"), 0); //The fading in of the dialogue box, affected by the Transition Speed CVAR SetFont("JFONT"); //Setting the font to display the character's name (2) HudMessage(l:"NANAMI"; HUDMSG_FADEINOUT, 11, CR_BLACK, 5.1, 193.2, 5, GetCVar("dn_transspeed"), 0); //The fading in of the character's name, retrieved from LANGUAGE and affected by the Transition Speed CVAR SetFont("DFONT"); //Setting the font to display if the character is speaking (3) HudMessage(s:"S P E A K I N G"; HUDMSG_FADEINOUT, 12, CR_WHITE, 345.1, 193.2, 5, GetCVar("dn_transspeed"), 0); //The fading in of "SPEAKING", affected by the Transition Speed CVAR Delay(HudMessageTime(HUDMSG_FADEINOUT, strlen("A"), GetCvar("dn_transspeed"), 0, 0)); //A delay script that what's for all of the images listed prior to display, affected by the Transition Speed CVAR SetFont("chiaa17"); //The character's display sprite (6) HudMessage(s:"A"; HUDMSG_PLAIN, 16, 0, 0.5, 0.5, 0); //The still image of the character that lasts forever SetFont("dtalk1"); //The dialogue box sprite (5) HudMessage(s:"A"; HUDMSG_PLAIN, 14, 0, 0.5, 0.5, 0); //The still image of the dialogue box that lasts forever SetFont("JFONT"); //The font used for the character's name (2) HudMessage(l:"NANAMI"; HUDMSG_PLAIN, 11, CR_BLACK, 5.1, 193.2, 0); //The still text of the character's name that lasts forever, retrieved from LANGUAGE SetFont("DFONT"); //The font used for whether the character is speaking (3) HudMessage(s:"S P E A K I N G"; HUDMSG_PLAIN, 12, CR_WHITE, 345.1, 193.2, 0); //The still text of "SPEAKING" SetFont("BIGFONT"); //The font used for character dialogue HudMessage(l:"CHIA1LINE1"; HUDMSG_TYPEON, 10, CR_WHITE, 10.1, 205.1, 0.5, GetCvar("dn_textspeed"), 0); //The typing-on display of the character's dialogue, retrieved from LANGUAGE and affected by the Text Speed CVAR Delay(HudMessageTime(HUDMSG_TYPEON, strlen(strparam(l:"CHIA1LINE1")), GetCvar("dn_textspeed"), 0.5, 0)); //The delay that waits for the character's dialogue to finish typing, retrieving the line from LANGUAGE and affected by the Text Speed CVAR HudMessage(l:"CHIA1LINE1"; HUDMSG_PLAIN, 10, CR_WHITE, 10.1, 205.1, 0); //The still text of the character's dialogue that lasts forever, retrieved from LANGUAGE (1) ACS_NamedExecute("PressUse",0,0,0,0); //Executes that script that checks for the player hitting "Use" (See below for the script) ACS_NamedExecute("WaitIcon",0,0,0,0); //Executes the flashing image that notifies that the character has finished speaking (4) (See below for the script) Until(Use==TRUE) //Delay that waits for feedback from the "PressUse" script { Delay(1); } ACS_NamedTerminate("PressUse",0); //Terminates the "PressUse" script ACS_NamedTerminate("WaitIcon",0); //Terminates the flashing continue icon Use = FALSE; //Sets the "Use" feedback to false HudMessage(s:""; HUDMSG_PLAIN, 10, 0, 0.5, 0.5, 0.1); //Removes the character's dialogue line HudMessage(s:""; HUDMSG_PLAIN, 13, 0, 0.5, 0.5, 0.1); //Removes the continue icon // At this point the rest of the dialogue continues on... Script "PressUse" (Void) //Script that checks if the player has hit "Use" { int buttons; Use = FALSE; While(TRUE) { buttons = GetPlayerInput(-1, MODINPUT_BUTTONS); If (buttons & BT_USE) { Use = TRUE; } Else { Use = FALSE; } Delay(1); } } Script "WaitIcon" (Void) //The flashing continue icon (4) { While(TRUE) { SetHUDSize(480, 280, TRUE); SetFont("dtalkc"); HudMessage(s:"A"; HUDMSG_FADEINOUT, 13, 0, 0.5, 0.5, 0, 0.5, 0.5); Delay(HudMessageTime(HUDMSG_FADEINOUT, strlen("A"), 0.5, 0, 0.5)); } } Script "Time" ENTER //Renders the time of day image (7) { SetHUDSize(480, 280, TRUE); SetFont("mtime"); HudMessage(s:"A"; HUDMSG_PLAIN, 20, 0, 0.1, 0.1, 0); }
Standard Dialogue Lines:
This is the script portion you will use if you want the character to continue talking, but not have an emotion change. See below for that.Character Emotion Change:Code: Select all
SetFont("FONT"); HudMessage(l:"LINE"; HUDMSG_TYPEON, 10, CR_WHITE, 10.1, 205.1, 0.5, GetCvar("TEXTCVAR"), 0); Delay(HudMessageTime(HUDMSG_TYPEON, strlen(strparam(l:"LINE")), GetCvar("TEXTCVAR"), 0.5, 0)); HudMessage(l:"LINE"; HUDMSG_PLAIN, 10, CR_WHITE, 10.1, 205.1, 0); ACS_NamedExecute("PressUse",0,0,0,0); ACS_NamedExecute("WaitIcon",0,0,0,0); Until(Use==TRUE) { Delay(1); } ACS_NamedTerminate("PressUse",0); ACS_NamedTerminate("WaitIcon",0); Use = FALSE; HudMessage(s:""; HUDMSG_PLAIN, 10, 0, 0.5, 0.5, 0.1); HudMessage(s:""; HUDMSG_PLAIN, 13, 0, 0.5, 0.5, 0.1);
If you want to continue talking to the same person, but have them them change emotion, use the following.Character Name Change:Code: Select all
SetFont("EMOTION1"); HudMessage(s:"A"; HUDMSG_FADEINOUT, 16, 0, 0.5, 0.5, 0, 0, GetCVar("TRANSITIONCVAR")); SetFont("EMOTION2"); HudMessage(s:"A"; HUDMSG_FADEINOUT, 15, 0, 0.5, 0.5, 0, GetCVar("TRANSITIONCVAR"), 0); Delay(HudMessageTime(HUDMSG_FADEINOUT, strlen("A"), 0, 0, GetCVar("TRANSITIONCVAR"))); SetFont("EMOTION2"); HudMessage(s:"A"; HUDMSG_PLAIN, 16, 0, 0.5, 0.5, 0); SetFont("FONT"); HudMessage(l:"LINE"; HUDMSG_TYPEON, 10, CR_WHITE, 10.1, 205.1, 0.5, GetCvar("TEXTCVAR"), 0); Delay(HudMessageTime(HUDMSG_TYPEON, strlen(strparam(l:"LINE")), GetCvar("TEXTCVAR"), 0.5, 0)); HudMessage(l:"LINE"; HUDMSG_PLAIN, 10, CR_WHITE, 10.1, 205.1, 0); ACS_NamedExecute("PressUse",0,0,0,0); ACS_NamedExecute("WaitIcon",0,0,0,0); Until(Use==TRUE) { Delay(1); } ACS_NamedTerminate("PressUse",0); ACS_NamedTerminate("WaitIcon",0); Use = FALSE; HudMessage(s:""; HUDMSG_PLAIN, 10, 0, 0.5, 0.5, 0.1); HudMessage(s:""; HUDMSG_PLAIN, 13, 0, 0.5, 0.5, 0.1);
This portion of script should be used if you want the character you play as to speak. Person A is the one who was speaking before, while person B is the one speaking the new line. Do remember that names are stored in LANGUAGE for this example.Both Name and Emotion Change:Code: Select all
SetFont("NAMEFONT"); HudMessage(l:"PERSON_A"; HUDMSG_FADEINOUT, 11, CR_BLACK, 5.1, 193.2, 0, 0, GetCVar("TRANSITIONCVAR")); Delay(HudMessageTime(HUDMSG_FADEINOUT, strlen("A"), 0, 0, GetCVar("TRANSITIONCVAR"))); HudMessage(l:"PERSON_B"; HUDMSG_FADEINOUT, 11, CR_BLACK, 5.1, 193.2, 0.5, GetCVar("TRANSITIONCVAR"), 0); Delay(HudMessageTime(HUDMSG_FADEINOUT, strlen("A"), 0, 0, GetCVar("TRANSITIONCVAR"))); HudMessage(l:"PERSON_B"; HUDMSG_PLAIN, 11, CR_BLACK, 5.1, 193.2, 0); SetFont("FONT"); HudMessage(l:"LINE"; HUDMSG_TYPEON, 10, CR_WHITE, 10.1, 205.1, 0.5, GetCvar("TEXTCVAR"), 0); Delay(HudMessageTime(HUDMSG_TYPEON, strlen(strparam(l:"LINE")), GetCvar("TEXTCVAR"), 0.5, 0)); HudMessage(l:"LINE"; HUDMSG_PLAIN, 10, CR_WHITE, 10.1, 205.1, 0); ACS_NamedExecute("PressUse",0,0,0,0); ACS_NamedExecute("WaitIcon",0,0,0,0); Until(Use==TRUE) { Delay(1); } ACS_NamedTerminate("PressUse",0); ACS_NamedTerminate("WaitIcon",0); Use = FALSE; HudMessage(s:""; HUDMSG_PLAIN, 10, 0, 0.5, 0.5, 0.1); HudMessage(s:""; HUDMSG_PLAIN, 13, 0, 0.5, 0.5, 0.1);
Let's say the character you play as has just finished talking. The person they're talking to then reacts with shock and says "What!" This script portion covers that. As before, Person A is the one who just spoke, but person B is the one changing emotion and speaking.Implementing Choices:Code: Select all
SetFont("NAMEFONT"); HudMessage(l:"PERSON_A_NAME"; HUDMSG_FADEINOUT, 11, CR_BLACK, 5.1, 193.2, 0, 0, GetCVar("TRANSITIONCVAR")); SetFont("PERSON_B_OLDEMOTION"); HudMessage(s:"A"; HUDMSG_FADEINOUT, 16, 0, 0.5, 0.5, 0, 0, GetCVar("TRANSITIONCVAR")); SetFont("PERSON_B_NEWEMOTION"); HudMessage(s:"A"; HUDMSG_FADEINOUT, 15, 0, 0.5, 0.5, 0, GetCVar("TRANSITIONCVAR"), 0); Delay(HudMessageTime(HUDMSG_FADEINOUT, strlen("A"), 0, 0, GetCVar("TRANSITIONCVAR"))); SetFont("NAMEFONT"); HudMessage(l:"PERSON_B_NAME"; HUDMSG_FADEINOUT, 11, CR_BLACK, 5.1, 193.2, 0.5, GetCVar("TRANSITIONCVAR"), 0); SetFont("PERSON_B_NEWEMOTION"); HudMessage(s:"A"; HUDMSG_PLAIN, 16, 0, 0.5, 0.5, 0); Delay(HudMessageTime(HUDMSG_FADEINOUT, strlen("A"), 0, 0, GetCVar("TRANSITIONCVAR"))); SetFont("NAMEFONT"); HudMessage(l:"PERSON_B_NAME"; HUDMSG_PLAIN, 11, CR_BLACK, 5.1, 193.2, 0); SetFont("FONT"); HudMessage(l:"LINE"; HUDMSG_TYPEON, 10, CR_WHITE, 10.1, 205.1, 0.5, GetCvar("TEXTCVAR"), 0); Delay(HudMessageTime(HUDMSG_TYPEON, strlen(strparam(l:"LINE")), GetCvar("TEXTCVAR"), 0.5, 0)); HudMessage(l:"LINE"; HUDMSG_PLAIN, 10, CR_WHITE, 10.1, 205.1, 0); ACS_NamedExecute("PressUse",0,0,0,0); ACS_NamedExecute("WaitIcon",0,0,0,0); Until(Use==TRUE) { Delay(1); } ACS_NamedTerminate("PressUse",0); ACS_NamedTerminate("WaitIcon",0); Use = FALSE; HudMessage(s:""; HUDMSG_PLAIN, 10, 0, 0.5, 0.5, 0.1); HudMessage(s:""; HUDMSG_PLAIN, 13, 0, 0.5, 0.5, 0.1);
No Visual Novel is complete without some form of choice making. The example included here is limited to two options to choose from, but some clever scripting can expand on it.
The following code is the script that controls choices.The script above is executed within one of the previous dialogue scripts, but the are some changes that must be made. Below is a standard dialogue script that calls for a choice to be made. The choice options are called from LANGUAGE.Code: Select all
Script "ChoiceOption" (Void) { SetHUDSize(480, 280, TRUE); int pitchselect; SetFont("choose1"); HudMessage(s:"A"; HUDMSG_FADEINOUT, 4, 0, 140.1, 70.1, 0.5, 0.5, 0); SetFont("choose2"); HudMessage(s:"A"; HUDMSG_FADEINOUT, 5, 0, 175.1, 86.1, 0.5, 0.5, 0); SetFont("FONT"); HudMessage(s:Option1; HUDMSG_FADEINOUT, 2, CR_WHITE, 185.1, 73.1, 0.5, 0.5, 0); HudMessage(s:Option2; HUDMSG_FADEINOUT, 3, CR_WHITE, 220.1, 90.1, 0.5, 0.5, 0); Delay(HudMessageTime(HUDMSG_FADEINOUT, strlen("A"), 0.5, 0.4, 0)); SetFont("choose1"); HudMessage(s:"A"; HUDMSG_PLAIN, 4, 0, 140.1, 70.1, 0); SetFont("choose2"); HudMessage(s:"A"; HUDMSG_PLAIN, 5, 0, 175.1, 86.1, 0); SetFont("FONT"); HudMessage(s:Option1; HUDMSG_PLAIN, 2, CR_WHITE, 185.1, 73.1, 0); HudMessage(s:Option2; HUDMSG_PLAIN, 3, CR_WHITE, 220.1, 90.1, 0); ACS_NamedExecute("PressUse",0,0,0,0); pitchselect = 1; Until(Use==TRUE) { If(pitchselect > 0) { SetFont("choose1"); HudMessage(s:"A"; HUDMSG_PLAIN, 4, 0, 140.1, 70.1, 0); SetFont("choose2"); HudMessage(s:"A"; HUDMSG_PLAIN, 5, 0, 175.1, 86.1, 0); pitchselect = 1; Choice = 1; } If(pitchselect < 0) { SetFont("choose1"); HudMessage(s:"A"; HUDMSG_PLAIN, 5, 0, 175.1, 86.1, 0); SetFont("choose2"); HudMessage(s:"A"; HUDMSG_PLAIN, 4, 0, 140.1, 70.1, 0); pitchselect = -1; Choice = -1; } pitchselect = GetPlayerInput(-1, INPUT_PITCH); Delay(1); } If(Choice==1) { SetFont("choose2"); HudMessage(s:"A"; HUDMSG_PLAIN, 4, 0, 140.1, 70.1, 0); Delay(2); SetFont("choose1"); HudMessage(s:"A"; HUDMSG_PLAIN, 4, 0, 140.1, 70.1, 0); Delay(2); SetFont("choose2"); HudMessage(s:"A"; HUDMSG_PLAIN, 4, 0, 140.1, 70.1, 0); Delay(2); SetFont("choose1"); HudMessage(s:"A"; HUDMSG_PLAIN, 4, 0, 140.1, 70.1, 0); Delay(2); SetFont("choose2"); HudMessage(s:"A"; HUDMSG_PLAIN, 4, 0, 140.1, 70.1, 0); Delay(2); SetFont("choose1"); HudMessage(s:"A"; HUDMSG_PLAIN, 4, 0, 140.1, 70.1, 0); Delay(2); } If(Choice==-1) { SetFont("choose2"); HudMessage(s:"A"; HUDMSG_PLAIN, 5, 0, 175.1, 86.1, 0); Delay(2); SetFont("choose1"); HudMessage(s:"A"; HUDMSG_PLAIN, 5, 0, 175.1, 86.1, 0); Delay(2); SetFont("choose2"); HudMessage(s:"A"; HUDMSG_PLAIN, 5, 0, 175.1, 86.1, 0); Delay(2); SetFont("choose1"); HudMessage(s:"A"; HUDMSG_PLAIN, 5, 0, 175.1, 86.1, 0); Delay(2); SetFont("choose2"); HudMessage(s:"A"; HUDMSG_PLAIN, 5, 0, 175.1, 86.1, 0); Delay(2); SetFont("choose1"); HudMessage(s:"A"; HUDMSG_PLAIN, 5, 0, 175.1, 86.1, 0); Delay(2); } SetFont("choose2"); HudMessage(s:"A"; HUDMSG_FADEINOUT, 4, 0, 140.1, 70.1, 0, 0, 0.5); HudMessage(s:"A"; HUDMSG_FADEINOUT, 5, 0, 175.1, 86.1, 0, 0, 0.5); SetFont("FONT"); HudMessage(s:Option1; HUDMSG_FADEINOUT, 2, CR_WHITE, 185.1, 73.1, 0, 0, 0.5); HudMessage(s:Option2; HUDMSG_FADEINOUT, 3, CR_WHITE, 220.1, 90.1, 0, 0, 0.5); Delay(HudMessageTime(HUDMSG_FADEINOUT, strlen("A"), 0, 0, 0.5)); HudMessage(s:""; HUDMSG_PLAIN, 4, 0, 140.1, 70.1, 0); HudMessage(s:""; HUDMSG_PLAIN, 5, 0, 175.1, 86.1, 0); HudMessage(s:""; HUDMSG_PLAIN, 2, 0, 150.1, 67.1, 0); HudMessage(s:""; HUDMSG_PLAIN, 3, 0, 185.1, 88.1, 0); pitchselect = 0; Selected = True; }
Now your script will will break into one of two IF statements, depending on the players choice. The return value of the Choice script is either 1 or -1. Below is an example:Code: Select all
SetFont("FONT"); HudMessage(l:"LINE"; HUDMSG_TYPEON, 10, CR_WHITE, 10.1, 205.1, 0.5, GetCvar("TEXTCVAR"), 0); Delay(HudMessageTime(HUDMSG_TYPEON, strlen(strparam(l:"LINE")), GetCvar("TEXTCVAR"), 0.5, 0)); HudMessage(l:"LINE"; HUDMSG_PLAIN, 10, CR_WHITE, 10.1, 205.1, 0); // From here on, there is a deviation from the standard dialogue script. Option1 = strparam(l:"OPTION1"); //Sets the first option choice Option2 = strparam(l:"OPTION2"); //Sets the second option choice ACS_NamedExecute("ChoiceOption",0,0,0,0); //Executes the script that displays the two choices Until(Selected==TRUE) //Waits on a choice to be made, not the player hitting "Use" { Delay(1); } ACS_NamedTerminate("PressUse",0); ACS_NamedTerminate("ChoiceOption",0); Use = FALSE; Selected = FALSE; //Sets the selection check to false Option1 = 0; //Sets the option to nothing Option2 = 0; //Sets the option to nothing Use = FALSE; HudMessage(s:""; HUDMSG_PLAIN, 10, 0, 0.5, 0.5, 0.1); HudMessage(s:""; HUDMSG_PLAIN, 13, 0, 0.5, 0.5, 0.1);
Finishing a Dialogue:Code: Select all
IF(Choice==1) { Choice = 0; //Sets the choice to nothing //Continues the dialogue, but with a shift in story based on choice } IF(Choice==-1) { Choice = 0; //Sets the choice to nothing // Continues the dialogue, but with a shift in story based on choice }
As with all good things, it eventually comes to an end, no matter how cute the girl you're talking to is or how funny that guy is, you'll eventually reach the end of a conversation. Use the following to end a conversation and regain control of the player. Person A is the character you are talking to.Code: Select all
SetFont("PERSON_A_CURRENTEMOTION"); HudMessage(s:"A"; HUDMSG_FADEINOUT, 16, 0, 0.5, 0.5, 0, 0, GetCVar("TRANSITIONCVAR")); SetFont("DIALOGUEBOX"); HudMessage(s:"A"; HUDMSG_FADEINOUT, 14, 0, 0.5, 0.5, 0, 0, GetCVar("TRANSITIONCVAR")); SetFont("NAMEFONT"); HudMessage(l:"NAME"; HUDMSG_FADEINOUT, 11, CR_BLACK, 5.1, 193.2, 0, 0, GetCVar("TRANSITIONCVAR")); SetFont("SPEAKFONT"); HudMessage(s:"S P E A K I N G"; HUDMSG_FADEINOUT, 12, CR_WHITE, 345.1, 193.2, 0, 0, GetCVar("TRANSITIONCVAR")); Delay(HudMessageTime(HUDMSG_FADEINOUT, strlen("A"), 0, 0, GetCVar("TRANSITIONCVAR"))); SetPlayerProperty(0,0,4);
Spoiler:CVAR INFORMATION:
The DesireDriven portion of the Visual Novel engine is much more creative, and in some ways, more visually pleasing. Conveniently, I found it to be more simple. However, due to the nature of the moving HudMessages, you may encounter some trial and error in applying it to your own images. Bold areas indicate that they can be easily changed to fit your needs. In dealing with HUDSize and position of HudMessages, it may take trial and error to properly format it to your needs.
The following is a set of scripts that are utilized almost no matter what. The "WideSupport" script should be changed to fit your needs.Introduction to Character Conversation (No character appears):Code: Select all
Script "WideSupport" ENTER { SetHUDSize(640, 440, TRUE); SetFont("WIDESUPPORT"); HudMessage(s:"A"; HUDMSG_PLAIN, 1, 0, 320.0, 220.0, 0); } Script "PressUse" (Void) { int buttons; Use = FALSE; While(TRUE) { buttons = GetPlayerInput(-1, MODINPUT_BUTTONS); If (buttons & BT_USE) { Use = TRUE; } Else { Use = FALSE; } Delay(1); } } Script "TextSound" (Void) { While(TRUE) { AmbientSound("SND/TEXT",255); If(GetCVAR("TEXTCVAR")==0.03) { Delay(3); } If(GetCVAR("TEXTCVAR")==0.01) { Delay(1); } If(GetCVAR("TEXTCVAR")>=0.04) { Delay(5); } } }
Use this portion of a script to start conversations between characters, but want an descriptive line to be displayed before a character appears on screen. See below if you want to start with a character saying a line.Introduction to Character Conversations (Character Appears):Code: Select all
Thing_Stop(0); SetPlayerProperty(0,1,4); SetHUDSize(640, 440, TRUE); int y; For(y = 600.0; y >= 200.0; y -= 25.0) { SetFont("DIALOGUEBOX"); HudMessage(s:"A"; 0, 20, -1, 320.0, y, 0); Delay(1); } For(y = 200.0; y <= 220.0; y += 5.0) { SetFont("DIALOGUEBOX"); HudMessage(s:"A"; 0, 20, -1, 320.0, y, 0); Delay(1); } HudMessage(s:"A"; 0, 20, -1, 320.0, 220.0, 0); SetFont("FONT"); ACS_NamedExecute("TextSound",0); HudMessage(l:"LINE"; HUDMSG_TYPEON|HUDMSG_COLORSTRING, 19, "Gray", 70.1, 175.1, 1.0, GetCVAR("TEXTCVAR"), 0); Delay(HudMessageTime(HUDMSG_TYPEON, strlen(strparam(l:"LINE")), GetCVAR("TEXTCVAR"), 0.0, 0.0)); HudMessage(l:"LINE"; HUDMSG_PLAIN|HUDMSG_COLORSTRING, 19, "Gray", 70.1, 175.1, 0); ACS_NamedTerminate("TextSound",0); ACS_NamedExecute("PressUse",0,0,0,0); Until(Use==TRUE) { Delay(1); } ACS_NamedTerminate("PressUse",0); Use = FALSE; HudMessage(s:""; HUDMSG_PLAIN, 19, 0, 0.5, 0.5, 0.1);
This brings up the dialogue box, then has a character appear without giving a description beforehand. I found the character on the left should always be the one to speak first.Character on the Right Appears:Code: Select all
Thing_Stop(0); SetPlayerProperty(0,1,4); SetHUDSize(640, 440, TRUE); int y; For(y = 600.0; y >= 200.0; y -= 25.0) { SetFont("DIALOGUEBOX"); HudMessage(s:"A"; 0, 20, -1, 320.0, y, 0); Delay(1); } For(y = 200.0; y <= 220.0; y += 5.0) { SetFont("DIALOGUEBOX"); HudMessage(s:"A"; 0, 20, -1, 320.0, y, 0); Delay(1); } HudMessage(s:"A"; 0, 20, -1, 320.0, 220.0, 0); SetFont("PERSON_LEFT"); int X; For(x = 20.0; x <= 320.0; x += 25.0) { HudMessage(s:"A"; 0, 15, -1, x, 220.0, 0); Delay(1); } SetFont("PERSON_LEFT_TALK"); HudMessage(s:"A"; 0, 15, -1, 320.0, 220.0, 0); SetFont("FONT"); ACS_NamedExecute("TextSound",0); HudMessage(l:"LINE"; HUDMSG_TYPEON|HUDMSG_COLORSTRING, 19, "Green", 240.1, 175.1, 1.0, GetCVAR("TEXTCVAR"), 0); Delay(HudMessageTime(HUDMSG_TYPEON, strlen(strparam(l:"LINE")), GetCVAR("TEXTCVAR"), 0.0, 0.0)); HudMessage(l:"LINE"; HUDMSG_PLAIN|HUDMSG_COLORSTRING, 19, "Green", 240.1, 175.1, 0); ACS_NamedTerminate("TextSound",0); SetFont("PERSON_LEFT"); HudMessage(s:"A"; 0, 15, -1, 320.0, 220.0, 0); ACS_NamedExecute("PressUse",0,0,0,0); Until(Use==TRUE) { Delay(1); } ACS_NamedTerminate("PressUse",0); Use = FALSE; HudMessage(s:""; HUDMSG_PLAIN, 19, 0, 0.5, 0.5, 0.1);
This is when the character on the left gives way to let the character on the right speak.Character on the Left Appears:Code: Select all
For(x = 320.0; x >= -320.0; x -= 25.0) { SetFont("PERSON_LEFT"); HudMessage(s:"A"; 0, 15, -1, x, 220.0, 0); SetFont("PERSON_RIGHT"); HudMessage(s:"A"; 0, 16, -1, x+640.0, 220.0, 0); Delay(1); } SetFont("PERSON_RIGHT_TALK"); HudMessage(s:"A"; 0, 16, -1, 320.0, 220.0, 0); SetFont("FONT"); ACS_NamedExecute("TextSound",0); HudMessage(l:"LINE"; HUDMSG_TYPEON|HUDMSG_COLORSTRING, 19, "Blue", 70.1, 175.1, 1.0, GetCVAR("TEXTCVAR"), 0); Delay(HudMessageTime(HUDMSG_TYPEON, strlen(strparam(l:"LINE")), GetCVAR("TEXTSPEED"), 0.0, 0.0)); HudMessage(l:"LINE"; HUDMSG_PLAIN|HUDMSG_COLORSTRING, 19, "Blue", 70.1, 175.1, 0); ACS_NamedTerminate("TextSound",0); SetFont("PERSON_RIGHT"); HudMessage(s:"A"; 0, 16, -1, 320.0, 220.0, 0); ACS_NamedExecute("PressUse",0,0,0,0); Until(Use==TRUE) { Delay(1); } ACS_NamedTerminate("PressUse",0); Use = FALSE; HudMessage(s:""; HUDMSG_PLAIN, 19, 0, 0.5, 0.5, 0.1);
This is when the character on the right gives way to the character on the left.Standard Character Dialogue (No character shift):Code: Select all
For(x = -320.0; x <= 320.0; x += 25.0) { SetFont("PERSON_LEFT"); HudMessage(s:"A"; 0, 15, -1, x, 220.0, 0); SetFont("PERSON_RIGHT"); HudMessage(s:"A"; 0, 16, -1, x+640.0, 220.0, 0); Delay(1); } SetFont("PERSON_LEFT_TALK"); HudMessage(s:"A"; 0, 15, -1, 320.0, 220.0, 0); SetFont("FONT"); ACS_NamedExecute("TextSound",0); HudMessage(l:"LINE"; HUDMSG_TYPEON|HUDMSG_COLORSTRING, 19, "Green", 240.1, 175.1, 5.0, GetCVAR("TEXTSPEED"), 0); Delay(HudMessageTime(HUDMSG_TYPEON, strlen(strparam(l:"LINE")), GetCVAR("TEXTSPEED"), 0.0, 0.0)); HudMessage(l:"LINE"; HUDMSG_PLAIN|HUDMSG_COLORSTRING, 19, "Green", 240.1, 175.1, 0); ACS_NamedTerminate("TextSound",0); SetFont("PERSON_LEFT"); HudMessage(s:"A"; 0, 15, -1, 320.0, 220.0, 0); ACS_NamedExecute("PressUse",0,0,0,0); Until(Use==TRUE) { Delay(1); } ACS_NamedTerminate("PressUse",0); Use = FALSE; HudMessage(s:""; HUDMSG_PLAIN, 19, 0, 0.5, 0.5, 0.1);
Left:Right:Code: Select all
SetFont("PERSON_LEFT_TALK"); HudMessage(s:"A"; 0, 15, -1, 320.0, 220.0, 0); SetFont("FONT"); ACS_NamedExecute("TextSound",0); HudMessage(l:"LINE"; HUDMSG_TYPEON|HUDMSG_COLORSTRING, 19, "Green", 240.1, 175.1, 5.0, GetCVAR("TEXTSPEED"), 0); Delay(HudMessageTime(HUDMSG_TYPEON, strlen(strparam(l:"LINE")), GetCVAR("TEXTSPEED"), 0.0, 0.0)); HudMessage(l:"LINE"; HUDMSG_PLAIN|HUDMSG_COLORSTRING, 19, "Green", 240.1, 175.1, 0); ACS_NamedTerminate("TextSound",0); SetFont("PERSON_LEFT"); HudMessage(s:"A"; 0, 15, -1, 320.0, 220.0, 0); ACS_NamedExecute("PressUse",0,0,0,0); Until(Use==TRUE) { Delay(1); } ACS_NamedTerminate("PressUse",0); Use = FALSE; HudMessage(s:""; HUDMSG_PLAIN, 19, 0, 0.5, 0.5, 0.1);
Character Dialogue End:Code: Select all
SetFont("PERSON_RIGHT_TALK"); HudMessage(s:"A"; 0, 16, -1, 320.0, 220.0, 0); SetFont("FONT"); ACS_NamedExecute("TextSound",0); HudMessage(l:"LINE"; HUDMSG_TYPEON|HUDMSG_COLORSTRING, 19, "Blue", 70.1, 175.1, 1.0, GetCVAR("TEXTCVAR"), 0); Delay(HudMessageTime(HUDMSG_TYPEON, strlen(strparam(l:"LINE")), GetCVAR("TEXTSPEED"), 0.0, 0.0)); HudMessage(l:"LINE"; HUDMSG_PLAIN|HUDMSG_COLORSTRING, 19, "Blue", 70.1, 175.1, 0); ACS_NamedTerminate("TextSound",0); SetFont("PERSON_RIGHT"); HudMessage(s:"A"; 0, 16, -1, 320.0, 220.0, 0); ACS_NamedExecute("PressUse",0,0,0,0); Until(Use==TRUE) { Delay(1); } ACS_NamedTerminate("PressUse",0); Use = FALSE; HudMessage(s:""; HUDMSG_PLAIN, 19, 0, 0.5, 0.5, 0.1);
Ends with the left character leaving:Ends with the right character leaving:Code: Select all
For(x = 320.0; x >= -320.0; x -= 25.0) { SetFont("PERSON_LEFT"); HudMessage(s:"A"; 0, 15, -1, x, 220.0, 0); Delay(1); } SetFont("DIALOGUEBOX"); For(y = 220.0; y >= 200.0; y -= 5.0) { HudMessage(s:"A"; 0, 20, -1, 320.0, y, 0); Delay(1); } For(y = 200.0; y <= 600.0; y += 25.0) { HudMessage(s:"A"; 0, 20, -1, 320.0, y, 0); Delay(1); } SetPlayerProperty(0,0,4); }
Description Box Appears:Code: Select all
For(x = -320.0; x <= 320.0; x += 25.0) { SetFont("PERSON_RIGHT"); HudMessage(s:"A"; 0, 16, -1, x+640.0, 220.0, 0); Delay(1); } SetFont("DIALOGUEBOX"); For(y = 220.0; y >= 200.0; y -= 5.0) { HudMessage(s:"A"; 0, 20, -1, 320.0, y, 0); Delay(1); } For(y = 200.0; y <= 600.0; y += 25.0) { HudMessage(s:"A"; 0, 20, -1, 320.0, y, 0); Delay(1); } SetPlayerProperty(0,0,4); }
Use this to bring up a description box, but have no character appear.Standard Description Line:Code: Select all
Thing_Stop(0); SetPlayerProperty(0,1,4); SetHUDSize(640, 440, TRUE); SetFont("DESCRIPTIONBOX"); int y; For(y = 600.0; y >= 200.0; y -= 25.0) { HudMessage(s:"A"; 0, 20, -1, 320.0, y, 0); Delay(1); } For(y = 200.0; y <= 220.0; y += 5.0) { HudMessage(s:"A"; 0, 20, -1, 320.0, y, 0); Delay(1); } HudMessage(s:"A"; 0, 20, -1, 320.0, 220.0, 0); SetFont("FONT"); ACS_NamedExecute("TextSound",0); HudMessage(l:"LINE"; HUDMSG_TYPEON|HUDMSG_COLORSTRING, 19, "Gray", 70.1, 295.1, 1.0, GetCVAR("TEXTCVAR"), 0); Delay(HudMessageTime(HUDMSG_TYPEON, strlen(strparam(l:"LINE")), GetCVAR("TEXTSPEED"), 0.0, 0.0)); HudMessage(l:"LINE"; HUDMSG_PLAIN|HUDMSG_COLORSTRING, 19, "Gray", 70.1, 295.1, 0); ACS_NamedTerminate("TextSound",0); ACS_NamedExecute("PressUse",0,0,0,0); Until(Use==TRUE) { Delay(1); } ACS_NamedTerminate("PressUse",0); Use = FALSE; HudMessage(s:""; HUDMSG_PLAIN, 19, 0, 0.5, 0.5, 0.1);
Use this when you have multiple lines of description.Dismiss Description Box:Code: Select all
SetFont("FONT"); ACS_NamedExecute("TextSound",0); HudMessage(l:"LINE"; HUDMSG_TYPEON|HUDMSG_COLORSTRING, 19, "Gray", 70.1, 295.1, 1.0, GetCVAR("TEXTCVAR"), 0); Delay(HudMessageTime(HUDMSG_TYPEON, strlen(strparam(l:"LINE")), GetCVAR("TEXTSPEED"), 0.0, 0.0)); HudMessage(l:"LINE"; HUDMSG_PLAIN|HUDMSG_COLORSTRING, 19, "Gray", 70.1, 295.1, 0); ACS_NamedTerminate("TextSound",0); ACS_NamedExecute("PressUse",0,0,0,0); Until(Use==TRUE) { Delay(1); } ACS_NamedTerminate("PressUse",0); Use = FALSE; HudMessage(s:""; HUDMSG_PLAIN, 19, 0, 0.5, 0.5, 0.1);
Use this to put away the description box when you're finished with it.Code: Select all
SetFont("DESCRIPTIONBOX"); For(y = 220.0; y >= 200.0; y -= 5.0) { HudMessage(s:"A"; 0, 20, -1, 320.0, y, 0); Delay(1); } For(y = 200.0; y <= 600.0; y += 25.0) { HudMessage(s:"A"; 0, 20, -1, 320.0, y, 0); Delay(1); } SetPlayerProperty(0,0,4);
Spoiler:
Both of these engines rely on similar CVARs. Listed below is how I have formatted the ones used throughout.
CVARINFO lump:MENUDEF lump:Code: Select all
user float textspeed = 0.02; //Handles how quickly the text types on-screen user float transspeed = 0.5; //Handles how quickly transitions take place (Not used in DesireDriven)
Code: Select all
OptionValue "TxtSpeed" { 0.05, "Slow" 0.03, "Medium" 0.01, "Fast" } OptionValue "TrnsSpeed" { 1, "Slow" 0.5, "Medium" 0.2, "Fast" 0, "Instant" } OptionMenu "YOURSettings" { Title "YOUR Settings" StaticText " " StaticText "Instant Effect" Option "Text Speed", "textspeed", "TxtSpeed" Option "Transition Speed", "transspeed", "TrnsSpeed" }