Heylo. I found this text engine on the old invision free ZFGC, and I need a bit of help. When I go up to the sign and press A, I get an error that says "unknown variable: global.firsttimedrawbox" Here's the script with the problem. One more thing. The error is on Line 53 where it says if(global.firsttimedrawbox = 0)...
//argument0 = the text
//argument1 = whether or not to draw the box at the end
//argument2 = whether or not to initiate the text
//argument3 = whether or not to draw the text box
//argument4 = the picture to use
//` = white text
//^ = red text
//{ = blue text
//} = green text
//[ = yellow text
global.drawingtext = true //the game is drawing text
if argument2 = true //if it is the first time through
{
self.position = 1//set the position as 1
self.done = false //the text isn't done
}
global.text = argument0
global.more = argument1
global.font = sprLettersWhite //set the font at the beggining of the script
//sets the postion of the pointer, so it knows how much text should be drawn
if keyboard_check(vk_enter) = true //if enter is pushed
{
self.done = true //you are done
self.position = string_length(global.text) //end the text
self.curstring = global.text //set the string to the text
keyboard_clear(vk_enter) //stop generating events
}
if self.done = false //if the text line isn't done
{
self.curstring = string_copy(global.text, 1, self.position) //the first line is a part of the actual first line
if string_length(self.curstring) = string_length(global.text) //if the text is done
{
self.done = true //this line is done
self.position = 1 //reset the start point
}
}
if self.done = false //if not all text is done
{
self.position += 1 //add one to the position
}
//draws the important stuff
if argument4 <> 0 //if a picture was selected
{
if (global.firsttimedrawboxpic=0) {
draw_sprite(sprPhotoBox, 0, view_x[0] + 16, view_y[0] + 108) //draw the box
draw_sprite(argument4, 0, view_x[0] + 22, view_y[0] + 114) //draw the picture
global.firsttimedrawboxpic=1;
}
}
if argument3 = true //if you should draw the text box
{
if (global.firsttimedrawbox=0) {
draw_sprite(sprTextBox, 0, view_x[0] + 16, view_y[0] + 160) //draw the text box
global.firsttimedrawbox=1;
}
}
self.pointx = 22 //a little to the right...
self.pointy = 166 //a little down...
for(i = 1; i < string_length(self.curstring) + 1; i += 1) //once for every character
{
self.lettertemp = string_copy(self.curstring, i, 1) //get the letter
if self.pointx >= 270 //if it is too far over
{
self.pointx = 22 //go back a bit
self.pointy += 16 //go down a line
}
if self.lettertemp <> " " and self.lettertemp <> "~" and self.lettertemp <> "|"//if it isn't a space or a tilde
{
if self.lettertemp <> "`" and self.lettertemp <> "^" and self.lettertemp <> "{" and self.lettertemp <> "}" and self.lettertemp <> "["//if it's not changing the font
{
self.todraw = get_letter(self.lettertemp) //get the imagesingle of the value
draw_sprite(global.font, self.todraw, view_x[0] + self.pointx, view_y[0] + self.pointy)
self.pointx += 8//move over for the next letter
}
else //if it is changing the font
{
if self.lettertemp = "`" //set it white
{
global.font = sprLettersWhite //sets it
}
if self.lettertemp = "^" //the caret
{
global.font = sprLettersRed //sets it
}
if self.lettertemp = "{" //blue
{
global.font = sprLettersBlue //sets it
}
if self.lettertemp = "}" //green
{
global.font = sprLettersGreen //sets it
}
if self.lettertemp = "[" //yellow
{
global.font = sprLettersYellow //sets it
}
}
}
if self.lettertemp = " " //if it is a space
{
self.pointx += 8 //move over for the next letter
}
if self.lettertemp = "~" //if it is a tilde
{
self.pointy += 16 //move down for the next letter
self.pointx = 22 //reset to the start of the line
}
}
if self.lettertemp = "|" //if it is a pipe
{
sleep(100) //sleep a while
}
screen_refresh() //refreshes the screen so you can actually see it
if self.done = true and global.more = true //if we need to draw an arrow
{
draw_sprite(sprTextMore, 0, view_x[0] + 155, view_y[0] + 216) //draw the arrow
}
if self.done = false //if the text isn't done
{
sleep(30) //pretty fast
dialog_box(argument0, argument1, false, argument3, argument4) //do it all again
}
else //yer done!
{
screen_refresh() //refresh the screen
keyboard_wait() //wait for the keyboard
sleep(30)
global.drawingtext = false //get on with your regular life
global.firsttimedrawbox=0;
global.firsttimedrawboxpic=0;
screen_redraw() //redraw the screen
Thanks people!