ID:139240
 
Code:
mob/proc/text_box(var/text,var/x1,var/x2,var/y1,var/y2)
// Width and Height spacing for displaying text.
var/WIDTH = 10
var/HEIGHT = 14

// Distance to offset characters inside of Text Box from edges
var/edge_offset_x = 16
var/edge_offset_y = -25

// CHAR_X is maximum characters left to right
// CHAR_Y is maximum lines of characters top to bottom
var/CHAR_X = ( ( (x2 - x1) * 32) - (edge_offset_x * 2) ) / WIDTH )
var/CHAR_Y = ( ( (y2 - y1) * 32) - (edge_offset_y * 2) ) / HEIGHT )
var/CURRENT_CHAR = 1
var/CURRENT_Y = 1


Problem description:

Text.dm:14:error: ): expected }
Text.dm:5:error: location of top-most unmatched {


Line 5 is var/WIDTH
Line 14 is var/CHAR_X


I have no idea why its giving me this error, I'm not using a { or } anywhere, and I believe all my parenthesis are correct.

I'm not sure, I just woke up and my eyes are still a bit nonfuctional :p.
But try adding another parenthesis at the front of CHAR_X and CHAR_Y:
    var/CHAR_X = ( ( ( (x2 - x1) * 32) - (edge_offset_x * 2) ) / WIDTH )
var/CHAR_Y = ( ( ( (y2 - y1) * 32) - (edge_offset_y * 2) ) / HEIGHT )
In response to Raimo
That worked, thank you, though I'm not entirely sure why. I had counted those several times, me being on the other end of the tired scale.
In response to Jotdaniel
I just checked which '(' parenthesis was linked to a ')' parenthesis, then I found out that the last ')' parenthesis on the end, didn't had a '(' parenthesis which was linked to it.

(Sorry if that was a weird explanation.)
In response to Jotdaniel
Pro tip: When you are dog tired, start on the left of the line and add one each time you hit (, subtract one when you hit ), moving your cursor across the line as you do this.

Say it out loud for good measure. If you ever say "minus one" / "negative one", or reach the end and say anything other than "zero", you done goof'd, son, and the cursor will show you where.
In response to Stephen001
Heh, I can spot it pretty easily now, good advice though.