|
|
In this tutorial you will learn…
Some more message box codes
How to use them
Hi there, and welcome to the last of my Basic Eventing tutorials. In this tutorial, I'll be showing you the other message box codes that you can enter
to display different things in the message box. So, let's get going!
Find somewhere clear to work, and make a new event. The first thing I'm going to show you is how to use the \v[x] code. This code, when entered, displays the
number stored in the variable number x (obviously, you'll enter a number here, and the code will display the value held in that number variable). You can
use this in many different ways to show a value that changes. For example, I've made a little system where you can pick flowers, and, when you speak to an NPC
in the middle of the screen, she'll tell you how many you've picked. The NPC's event looks like this…
I am using variable number 23, hence the \v[23] code in the text. The flower events look like this…
The first command is adding 1 (note that we don't use the set command for the variable, because otherwise it would always be set to 1; we need to add to
the value that is already in the variable), and the second is just turning on a self switch which changes to a new page with no event graphic, giving the effect
of the flower disappearing. Obviously, if this were a real game, you'd probably want to add a Change Items command and increase the number of Flowers in the
player's inventory, but for this demo we don't need to worry about that.
So, let's see our system in action. Before I pick any flowers, this is what the NPC says…
All uninitialised variables start at 0. When we pick a flower, this changes, however…
You can see that the value has changed. (Also, most of you will notice that the grammar is now no longer correct; this is something
that we could correct with a conditional branch.) When I pick some more flowers, the variable value changes accordingly…
If we were making this a real system, we'd probably want to add in some conditional branches so that when we collect all the flowers, she says something else and
other little features like that, but this is only a demonstration, so we won't worry about that for now.
You can probably already see the advantages of this little bit of code. As long as you remember that it's only variables and not the number of items in your
inventory, then you can use this a lot.
The next code is the \g code, which shows a money window in the corner of the screen. You can enter this code anywhere in the message and the window will be
displayed for the duration of the message. When the message is finished, unless the next message text doesn't contain the \g code. When using this code with a
batch text entry, you need to make sure that there is a \g code in every section, like so, otherwise the money window will disappear…
You can see that I've inserted a \g code into every new text box. Just experiment a bit to get the hang of it. When viewed, the window looks like this…
Next are the \c[x] codes. These change the colour of the following text until you change it to something else. Take a look at the text box here…
When viewed in game, the message boxes look something like this…
Again, you'll see that if you don't redefine the colour at the start of each new text window, the colour reverts to the original white. This time, however, you'd
need to do it at the start of each line, like so…
You can see where they'd have to go.
Finally, there is one last little code that I can teach you: \\. This code just inserts the \ character - but, because it is a special character (an
escape character, officially), you need to type two of them to get it to show up in your message box. If you typed three of them, you'd get two, and so on.
Well, I hope you've learned about all the different message box codes. They always come in extremely handy. With a bit of know-how, you can even write your
own message box codes to do things like make the text italic or bold, or inserting icons and other values - but that's a tutorial for another day. That concludes
my Basic Eventing tutorials; I hope you've found them helpful. If you're ready to move onto something a little more complicated, take a look at my
Advanced Eventing tutorials or my Advanced Mapping tutorials for more complex
systems and methods. Or, if you like, go to the Sitemap and pick whatever takes your fancy.
:: << Previous Tutorial ::
:: Home ::
|
|