ID:1405827
 
(See the best response by Albro1.)
Problem description:
Looked around for some Maptext libraries and found FlysBad's , it worked pretty nicely so I decided to use some of the knowledge I gained to give it a try for my own maptext.

Haven't even tested if this works or not, I am asking here for some feedback on this, and if it indeed is flawed I would want you to point out it's flaws so I can improve myself. Thanks o;
Code:
MapText

parent_type = /obj

var FONT = "Arial"
var SIZE = 2
var ALIGN = "CENTER, CENTER"
var COLOR = "White"
var LAYER = FLY_LAYER
var WIDTH = 200
var HEIGHT = 32
var TEXT


proc/MapText()

src.maptext_width = WIDTH
src.maptext_height = HEIGHT
src.SIZE = SIZE


src.FONT = "[FONT]"
src.TEXT = "[TEXT]"
src.ALIGN = "[ALIGN]"
src.COLOR = "[COLOR]"
src.layer = "[LAYER]"


src.maptext = "<font face=[FONT]size=[SIZE]color=[COLOR]>[TEXT]</font>"





Best response
Layer is not a string, it is a number.

You may also want to put arguments into the MapText() proc, because right now all you're doing is setting your vars all over again. If you use named arguments in the proc, you can dynamically change the text.
In response to Albro1
So how about something like this:
MapText

parent_type = /obj

var FONT = "Arial"
var SIZE = 2
var ALIGN
var COLOR
var TEXT


proc/MapText(TEXT, WIDTH, HEIGHT, COLOR, ALIGN, LAYER)

src.maptext_width = WIDTH
src.maptext_height = HEIGHT
src.SIZE = SIZE


src.FONT = "[FONT]"
src.TEXT = TEXT
src.ALIGN = "[ALIGN]"
src.COLOR = "[COLOR]"
src.layer = "[LAYER]"


src.maptext = "<font face=[FONT]size=[SIZE]color=[COLOR]>[TEXT]</font>"

mob/verb
TEST()
new/MapText("Testing Testing", 200, 32, "white", "CENTER, CENTER", 1000)
You're still setting layer to a string (text value), which it should not be.
Not to mention creating the datum wrong.
Odd: didn't see these msgs up until now; anyway,

I have fixed the issue.

I have it working with:
MapText

parent_type = /obj

var FONT = "sans-serif"
var SIZE
var ALIGN
var COLOR
var TEXT

New(text, SCREEN_LOC = "NORTH: 1, WEST: 10", WIDTH=200, HEIGHT=32, SIZE=3, COLOR="white", ALIGN="LEFT", layer=1000)

src.layer = layer
src.MapText(text, WIDTH, HEIGHT, SIZE, COLOR, ALIGN, layer)


src.screen_loc = "[SCREEN_LOC]"
usr.client.screen += src


proc/MapText(text, WIDTH, HEIGHT, SIZE, COLOR, ALIGN, layer)

src.maptext_width = WIDTH
src.maptext_height = HEIGHT
src.SIZE = SIZE


src.FONT = FONT
src.TEXT = text
src.ALIGN = ALIGN
src.COLOR = COLOR


src.maptext = "<font face=[FONT] size=[SIZE] color=[COLOR] valign=top align=[ALIGN]>[text]</font>"



mob/verb
TEST(T as text)
new/MapText(T)


Anything you guys see wrong or that could use improvement please do speak out.