-
Notifications
You must be signed in to change notification settings - Fork 8
5.X Beginners Guide
This is the guide for Rumor scripting. If you are a developer interested in integrating Rumor into your project, see the Integrating Rumor guide instead.
Unfortunately, due to the nature that Rumor is only a framework, there is no easy way to try any of the examples in this guide right away. You will either need the assistance of a developer or you will need to integrate Rumor yourself. After Rumor has been integrated into a project, all examples can be saved in a text file and be run by Rumor. The exact process by which a text file is sent to Rumor, so it can be run, depends on how Rumor has been integrated.
Additionally, given the many different ways Rumor can be integrated, any sentence that refers to "input" from the user refers to the method by which Rumor is asked to advance to the next line. In most projects, this input will be a mouse button click, a keyboard button, or a controller button.
A Rumor script is a text file that contains commands. Usually, a programmer will load the script from disk and then compile it so it can be run in your game.
Alex: Hello world! The weather seems rather nice today, doesn't it?
Me: Yeah.
: I wasn't, in fact, paying attention at all to the weather.
Me: It sure is bright and sunny outside.
Alex: ...It's raining. I thought that was your favourite weather?
This is a basic Rumor script. It contains one of the most commonly-used commands in Rumor which sets the dialog.
This section will briefly go over commands that are available to your disposal.
The set variable command is used by providing the name of a variable, then an =
, then the expression to set the variable to.
oranges = { 5 }
In this case, you are assigning the value 5
to the variable oranges
. Rumor will not wait for input from the user before proceeding to the next line.
For more information about expressions and how to use them, see the Expressions page.
The set dialog command is used by providing the name of the speaker, then a :
, then the content the speaker should say. This command clears the stage and replaces it with the specified dialog.
Me: Hello world!
In this case, the stage is cleared and replaced it the character Me
saying the dialog Hello world!
. You can also omit the speaker, in which case the narrator will be used as the speaker instead:
: Hello world!
Rumor will wait for the user to advance the dialog before proceeding with execution.
The add dialog command is used by providing the name of the speaker, then a +
, then the content the speaker should say. This command is similar to the set dialog command, but it does not clear the stage.
You can use it to show two people speaking at the same time.
Me: I'm speaking at the same time as you.
You+ Hello!
When this is executed, the stage will first contain the speaker Me
saying I'm speaking at the same time as you.
. After input is received from the user, the stage will then also contain the speaker You
saying Hello!
.
The add dialog command can also be used to append more dialog to something a speaker is already saying.
Me: Hi...
Me+ how are you?
When this is executed, the stage will first contain the speaker Me
saying Hi...
. After input from the user, it will then contain the speaker Me
saying Hi... how are you?
.
Like the set dialog command, Rumor will wait for the user to advance the dialog before proceeding with execution.
Sometimes it may be nice to pause execution of the script for a moment before continuing. Pauses don't wait for input from a user.
Me: "Hi..."
pause { 1 } second
Me+ "how are you?"
When this is executed, the stage will contain the speaker Me
saying Hi...
. After input is received from the user, the dialog system will wait for one second before showing the speaker Me
saying Hi... how are you?
.
The choice command is used to offer the player a choice between several options.
: What would you like to do?
choice
> Open the closet
: You open the closet.
choice
> Go to the
living room
: You go to the living room.
choice
> Eat an orange
: You eat an orange.
choose
Here, the player sees the dialog "What would you like to do?" right before being offered the choices "Open the closet", "Go to the living room", and "Eat an orange".
If the player chooses "Eat an orange", they will then see the dialog "You eat an orange.". None of the other paths are executed.
Note that the player isn't required to choose a choice until the choose
command is used. The choose
command halts execution of the script until a choice is chosen.
Control flow commands are more advanced, but also let you have more interactive scripts.
if
, elif
, and else
are conditional commands that can be used to choose different options depending on the value of a variable. For example:
oranges = 3
if { oranges < 3 }
: You don't have enough oranges!
elif { oranges == 3 }
: You have just enough oranges.
else
: You have too many oranges!
These conditional commands can also be used to "skip" choices, in addition to many other uses. For example:
choice
> I turned away
: I turned away, for I had no money.
if { money >= 4 }
choice
> I paid 4 coins to enter.
money = { money - 4 }
: I entered the gates to the theme park.
choose
In the above example, the first choice is always added, but the second choice is never added unless the value of money
is greater than or equal to 4
. If the second choice is not added, the user will never see it.
A label is a location in the script that can be jumped to (which we are about to cover). Labels are also ways to categorize sections of code. You can add code to a label by indenting it (by either using tabs or spaces -- but pick one and stick with it!). For example:
label [oranges]
: How are you today?
: Do you have the oranges?
Note that if this script is executed, nothing will happen. In order to execute the contents of a label, you must jump to it.
The call
command moves execution to whichever label is specified. For example:
label [oranges]
: How are you today?
: Do you have the oranges?
call oranges
Me: No, I don't have the oranges.
In this example, Rumor will move execution to the oranges
label. Then, it will execute the children of the oranges
label. Lastly, the Rumor dialog system will exit the oranges
label, return execution to where the call started, and then print the last line of dialog.
The jump
command is like the call
command, except it never returns to where the jump was called.For example:
label [oranges]
: How are you today?
: Do you have the oranges?
jump oranges
: This will never be printed.
In this example, Rumor will move execution to the oranges
label. Then, it will execute the children of the oranges
label. Once the contents of the oranges
label are executed, the script ends and we don't see the dialog that was written after the jump.
The return statement is used to exit the label early. For example:
label [start]
: This will be printed.
return
: This will never be printed.
jump start
: This is still printed.
It can also be used to end execution, if used outside of a label
: This will be printed.
return
: This will never be printed.
More commands can also be found in the Command Reference