RPG Dialog: Parsing Text through Subapp Issue.
I'm working on a stupid simple RPG. I've just polished off grid-based movement and a zelda-esque scrolling project. Now I'm working on the dialog system. So far, I've created a new level that has a picture object, a character image object, and a getline extension. The getline extension pulls a script from a text file which I've formatted like this:
0001 <img>bin/ava/cold.bmp
0002 McFatmo: This is a sample script.
0003 McFatmo: The real script has a storyline, but this isn't it.
0004 McFatmo: Instead, you're reading this. This is nothing.
0005 <break>
0006 <img>bin/ava/circy.bmp
0007 Circy: Lame.
0008 <break>
0009 Do you like fish sticks?
0010 <break>
The GetLine extension pulls each line, removes the first five characters, then passes the line to the character image object. Then the first five characters in the character image object are checked. If the first five characters are <img>, it removes the five characters and treats the rest like a file path it passes to the picture object, it skips to the next line and if it's first five characters aren't recognized it passes the remaining text line to the character image object. In other words:
Start of Frame:
Character Image -> Word wrap on.
getLine -> Open File apppath$ +"bin\txt\script001.txt"
Character Image -> Set text Right$(CurLine$("getLine")), Len(CurrLine$("getLine"))-5)
Left$(Text$("Character Image"), 5) = "<img>":
Picture Object -> New Picture : Apppath$ + Right$(Text$("Character Image"), Len(Text$("Character Image"))-5)
GetLine -> Next Line.
Character Image -> Set text Right$(CurLine$("getLine")), Len(CurrLine$("getLine"))-5)
Text$("Character Image") = "<break>":
Character Image -> Set Text = ""
Upon pressing Space Bar OR(logical) Upon Pressing Page Down:
GetLine -> Next Line
Character Image -> Set text Right$(CurLine$("getLine")), Len(CurrLine$("getLine"))-5)
Upon pressing Page Up:
GetLine -> Previous Line
Character Image -> Set text Right$(CurLine$("getLine")), Len(CurrLine$("getLine"))-5)
The problem I'm having is when I hit the <break> lines. I need some way of passing a signal from the subapp to the first frame to hide the subapp. I don't want the player to be able to hide the subapp in the middle of a game text; so I was thinking about using a global value, but GlobalValue1 = 0 then hide? 1 then show? I don't necessarily want MMF2 checking a global value for a 1 or a 0 fifty times a second.
I was thinking about figuring out a specific key that advances the text. Test for subapp visibility, figure out what line the script is supposed to start on and end on. In the sub app, make the space advance the text. In frame1, make space bar increase counter +1. If the script is only supposed to show 5 lines, when counter =6 hide subapp? Would that work, or is there a better way to do this?
Any help?