Code:
NPC_HUD
proc
NPC_Talk(atom/m, obj/NPC, words)
if (!istype(m, /mob/players))
return
if (istype(NPC, /obj/shops))
Small_Box(m, NPC, words)
if (istype(NPC, /obj/active))
Small_Box(m, NPC, words)
Small_Box(atom/at, obj/NPC, words)
if (!istype(at, /mob/players))
return
var/mob/m = at
if (length(m.extended_text))
m.extended_text = ""
m.remove_all_from_screen(/obj/Hud_Controls/blank, 1)
m.remove_all_from_screen(/obj/Hud_Controls/text, 1)
m.remove_all_from_screen(/obj/Hud_Face/face, 1)
m.remove_all_from_screen(/obj/Hud_Boxes/Hud_Box_1, 1)
m.remove_all_from_screen(/obj/Hud_Boxes/Hud_Box_2, 1)
m.remove_all_from_screen(/obj/Hud_Boxes/Hud_Box_3, 1)
m.remove_all_from_screen(/obj/Hud_Boxes/Hud_Box_4, 1)
m.remove_all_from_screen(/obj/Hud_Boxes/Hud_Box_5, 1)
m.remove_all_from_screen(/obj/Hud_Boxes/Hud_Box_6, 1)
m.remove_all_from_screen(/obj/Hud_Boxes/Hud_Box_7, 1)
m.remove_all_from_screen(/obj/Hud_Boxes/Hud_Box_8, 1)
m.remove_all_from_screen(/obj/Hud_Boxes/Hud_Box_9, 1)
if (!words) return
var/new_words = copytext(words, 1, 35)
var/obj/Hud_Boxes/Hud_Box_1/H1 = new()
m.add_screen(H1)
H1.screen_loc = "1,1"
for (var/a = 2, a < 11, a ++)
var/obj/Hud_Boxes/Hud_Box_2/H2 = new()
m.add_screen(H2)
H2.screen_loc = "[a],1"
var/obj/Hud_Boxes/Hud_Box_5/H5 = new()
m.add_screen(H5)
H5.screen_loc = "[a],2"
var/obj/Hud_Boxes/Hud_Box_3/H3 = new()
m.add_screen(H3)
H3.screen_loc = "11,1"
var/obj/Hud_Boxes/Hud_Box_4/H4 = new()
m.add_screen(H4)
H4.screen_loc = "1,2"
var/obj/Hud_Boxes/Hud_Box_6/H6 = new()
m.add_screen(H6)
H6.screen_loc = "11,2"
var/obj/Hud_Face/face/npc_face = new()
npc_face.screen_loc = "1,2"
npc_face.layer = HUD_LAYER
npc_face.icon = 'Icons/faces.dmi'
npc_face.icon_state = "[NPC.name]"
m.add_screen(npc_face)
var/obj/Hud_Controls/text/mt = new()
mt.screen_loc = "2,2"
mt.layer = TEXT_LAYER
mt.maptext = "[MapText_Font][new_words]</b>"
m.add_screen(mt)
if (length(words) > 35)
m.extended_text = copytext(words, 35, length(words) + 1)
m.extended_NPC = NPC
var/obj/Hud_Controls/blank/b = new()
b.screen_loc = "11,1"
b.layer = HUD_LAYER + 1
b.maptext = "<center><font size = \"1\">[MapText_Font]Next"
m.add_screen(b)
Problem description:
NH.NPC_Talk (usr, src, "For exmaple") <-- does not work
NH.NPC_Talk (usr, src, "Forexample") <-- works fine
I am amusing copytext is not what I use because having spaces in a text is not a sting. So my question would be how do I avoid copytext.