Gw Temp

Menu

Tutorial - 'Custom Message Window Tutorial' by Mark of the Dragon

An item about RPG Toolkit posted on

Blurb

Another custom message window system tutorial, be sure to check out.

Body

Table of Contents
1-Intro
2-What is a MWin
3-Recommended Knowledge
4-A basic MWin
5-Adding Profile Pics
6-Other Fancy Goodies
7-Contact Info & Errors

***Intro***
Well, before I dive right into this tutorial, I would like to thank you for trusting me with this sort of thing, esp since my First Release, "Eternal Blade", sucked ass. Of course, I've learned enough RPGCode to make my current project, "The Crystal", as sweet as possible. I will not be using any default functions, and I will not use any resources from the shack except as a reference. You've probably downloaded this tutorial because you don't have a damn clue as to how to create a MWin. If you know how, then I'd suggest you stop reading this now and quit wasting your time. This tutorial is for the beginner, not for you advanced RPGCoders (that's right DTS, Jer1400 and MrG). If this is Xorlak, then I will NOT pay full price for Dark Age 2 (not likely, LOL).

***What is a MWin***
Well, I'm assuming that you DO know what a MWin is, but in case you don't, I'll explain it here. Most RPG's, if not all, have dialogue. This dialogue can occur in many forms, including Voiceovers, Subtitles, Message Windows, and god knows what else. The MWin is a message window, which is the most common form of dialogue in an RPG. In RPGToolkit, you can call the default Message Window with the #MWin(text$) syntax, although we all know that the default MWin is plain as hell. You have multi-colored text and sizeable text and that's about it. Custom MWins can offer much more. You can make a MWin with profile pics, a moveable mwin, a resizable mwin, and much more. Hell, even a translucent MWin is possible (easy as hell, I might add). All of these features are quite easy to add, and I'll explain most of them in this tutorial. If there is another feature that you can think of that I don't have listed here, then make it, and show it off! This is just a starter's tut., not an in-depth guide to creating the next XFMWin!

***Reccomended Knowledge***
First, you should be familiar with the #Text and #SetImage commands. Also, you should know what a #Method is. If you don't know what any of these are, then go back, learn them, and return to this tutorial. Else, continue on.

***A Basic MWin***
Nothing Fancy. Just a BG Image with 3 text support. Start off by making a method to setup the mwin like so:

#Method SetupWin(image$)
{
}

Now, in the brackets, type #SaveScreen() so that you can clear the MWin when you're done. Also, use the #SetImage command to set the mwin graphic (image$) anywhere onscreen. Easy so far, eh? Now, you're going to want to give yourself the ability to create text in the window, so set up a method like "Line1" or something. The total code should look like this so far:

#Method SetupWin(image$)
{
#SaveScreen
#SetImage(image$,x!,y!,width!,height!)
}
#Method Line1(text$)
{
}

In order to include text, you're going to use the text command. This is simple enough, but aligning the text can, and always will be, somewhat tricky, so you are going to spend quite a bit of time testing the alignment alone. If this scares a lot of you, don't worry. I've written 3 message windows so far, "Dragon's Eye MWin", "MRMWin" (not released, and won't be anytime soon), and "Kick@$$MWin" (which is for MY use only). MRMWin and Kick@$$MWin had many advanced features that I won't go into just yet, but if you really want to know, I'll explain most of these features at the bottom. In order to place the text, use this syntax:

#Text(x!,y!,text$)

When placing the text, you're going to use text$ like this:

#Text(x!,y!,"")

Repeat for the other lines. To clear the MWin, you can just use this:

#Method KillMWin()
{
#RestoreScreen
#Kill(text$)
}

***Adding Profile Pics***
Here's where the good stuff begins. If you don't know how to create a basic MWin, then I suggest that you read the last section before you get even more confused. The easiest way to do this is to alter the setup method like so:

#Method SetupWin(image$,profile$)
{
#SetImageTranslucent(image$,x!,y!,width!,height!)
#If(profile$~="")
{
#SetImageTransparent(profile$,x!,y!,width!,height!,r!,g!,b!)
}
}

You may find MANY other ways to do this, but this is my preferred way. It's the easiest to create, and the ease of use is quite good.

***Other Fancy Goodies***
-Resizable and Moveable MWins
This is simple enough...your methods should resemble this:
#Method SetupWin(image$,x!,y!,width!,height!,textx!,texty!)
{
#SetImage(image$,x!,y!,width!,height!)
}
#Method Line1(text$)
{
#Text(textx!,texty!,"")
#texty!=texty!+1
}
...And so on

-Translucency
If you HAVE to read this, then you are a complete moron. Just add the word "Translucent" after "SetImage" in you code. It should look like this:

#SetImageTranslucent(image$,x!,y!,width!,height!)

***Contact Info and Errors***
You can reach me the following ways:
email: dahawkster92@yahoo.com / markofdragon@mysticsoftware.net
AIM: ExcalRPG
YIM: dahawkster92
Website: http://markofdragon.mysticsoftware.net

If you see any errors with this tutorial, please do not hesitate to let me know so that I may fix this as soon as possible. If there is something that you would like me to explain in greater detail, then all you have to do is ask. I'll be more than happy to help you out.