So the problem I was having with the old message system was that I couldn’t have more than one line of dialogue. I couldn’t have little images of characters beside the text if I wanted too. I had to do a major overhaul of the message system as a whole to get it to where I wanted it.
So the way it used to work was that it would display a line of text when I wanted it to and I could write the text as a string in code. This proved to be a problem later on when I wanted more than one message box after another.
I wanted a way for the player to read multiple lines of text. The message system would pause in between lines and wait for the user to input an enter or mouse click or something like that; before it would continue.
After all the lines have been read, the game would resume. I also wanted to use what I already created for the message system so far because I already have it wrapping words and stuff so it would seem a waste to redesign that. It wasn’t too hard to extend what I already had into a multi-line system.
I started by creating a new game state called, GAMESTATEMESSAGE, and redesigned the message system to have a current line variable that tracked what line the player was reading and a method for skipping the message forward. The class also changes the game state back to the previous state when all the messages have been read.
Now when the game needs to show the player a message it will call a “group” of messages that are linked to an id and display them one at a time after the player clicks the mouse or presses enter.
I also had to create another class called the MessageHandler which basically displays the message group based on which ID was being called at that time. It also has a list of all message IDs that are used in the game and are listed by name making it easier to program. It’s working well so far.
Remelic