ID:147965
 
I have a (seemingly) strange problem with my code. When I build the item following in the lines of code and try to name it, I get a runtime error message. Then I get another one when I bump it. I activated debug mode, and the code follows.

Wall_Sign()
set category = "Build"
for(var/obj/q in usr.loc)
if(q.nobuild == 1)
src << "You cannot build here."
return
else
del q
view() << "[usr] builds a wall sign."
var/a = new/obj/Wall_Sign(usr.loc)
a:owner = "[usr.key]"
a:msg = input("What should the sign say?","Creating sign")as text //This is the line the debug mode refers to.
if(a:msg == "")
a:name = "Wall Sign"
else
a:name = "[a:msg]"

Also...

mob
Bump(atom/O)
if(istype(O,/obj/Wall_Sign))
usr << "
[O:msg]" //This is the other line the debug mode refers to.
usr << "
[O:owner]"

The debug messages follow.

Undefined variable /obj/Wall_Sign/var/msg.
proc name: Wall Sign (/mob/Build/verb/Wall_Sign)
source file: building.dm,262
usr: Enigmaster2002 (/mob/characters/auyen)
src: Enigmaster2002 (/client)
call stack:
Enigmaster2002 (/client): Wall Sign()
runtime error: undefined variable /obj/Wall_Sign/var/msg
proc name: Bump (/mob/Bump)
source file: building.dm,706
usr: Enigmaster2002 (/mob/characters/auyen)
src: Enigmaster2002 (/mob/characters/auyen)
call stack:
Enigmaster2002 (/mob/characters/auyen): Bump(Wall Sign (/obj/Wall_Sign))
Enigmaster2002 (/mob/characters/auyen): Move(the grass (20,6,1) (/turf/grass), 8)

Anyone that could tell me what the problem is or how to fix it would be greatly appreciated.
a:msg = input("What should the sign say?","Creating sign")as text //This is the line the debug mode refers to.

You didn't post the debug message but I'm sure the issue is that you are misusing a colon and whatever a is doesn't have a msg variable which is cause for the error.