ID:177169
 
mob/var/message

obj/Paper

icon='paper.dmi'
icon_state="iron"

verb/Pickup()
set src in oview(0)
usr.contents+=new/obj/Paper
del(src)

verb/Write_message()
src.message = input("this paper is blank") as message

verb/Read_message(mob/M in view())
src<< M.message

verb/Drop()
set src in usr.contents
src.Move(usr.loc)

What is wrong with this, i keep getting, src.message bad var
src is the atom that the verb belongs to.
usr is the last atom to take an action. In the case of a verb, it's always the mob using the verb.
SkylineR34 wrote:
mob/var/message

obj/Paper

icon='paper.dmi'
icon_state="iron"

verb/Pickup()
set src in oview(0)
usr.contents+=new/obj/Paper
del(src)

verb/Write_message()
src.message = input("this paper is blank") as message

verb/Read_message(mob/M in view())
src<< M.message

verb/Drop()
set src in usr.contents
src.Move(usr.loc)

What is wrong with this, i keep getting, src.message bad var

Look over the first lines again:
mob/var/message     

obj/Paper
Notice something?
All your verbs are declared for /obj/Paper, which is correct, but the message var was set up for /mob, which is not correct. usr.message could be set due to the way you handled this, but since the goal is for each individual paper--not each player--to have a message, it should still be src.message and the var should belong to /obj/Paper instead.

Concerning your Pickup() and Drop() verbs, I have a suggestion: Change anything that would use Pickup() and Drop() into /obj/item, so that /obj/Paper becomes /obj/item/paper. Then define those verbs for /obj/item.

Lummox JR
You never defined the variable message

obj/Paper
icon='paper.dmi'
icon_state="iron"
var
message
In response to Garthor
ok im trying to figure this out now,
In response to Lummox JR
ive changed it to this..


obj/Paper

icon='paper.dmi'
icon_state="iron"
var/message
verb/Pickup()
set src in oview(0)
usr.contents+=new/obj/Paper
del(src)

verb/Write_message()
src.message = input("this paper is blank") as message

verb/Read_message(mob/M in view())
src<< M.message

verb/Drop()
set src in usr.contents
src.Move(usr.loc)



but now i get, m.message bad var
In response to SkylineR34
because message is an obj/paper variable, not a mob variable.
In response to SkylineR34
SkylineR34 wrote:
ive changed it to this..


obj/Paper

icon='paper.dmi'
icon_state="iron"
var/message
verb/Pickup()
set src in oview(0)
usr.contents+=new/obj/Paper
del(src)

Problem in Pickup(): Why are you creating a brand new piece of paper and erasing the old one? Shouldn't you just do src.loc=usr and be done with it?

verb/Write_message()
src.message = input("this paper is blank") as message

verb/Read_message(mob/M in view())
src<< M.message

The error you're getting is in Read_message. You've got this set up as if the message belongs to the mob; the message belongs to the paper, so that mob/M in view() bit is totally out of place.
verb/Read_message()
set src in view()
usr << message
(That's src.message, incidentally.)

If I were you I'd shorten those verbs to "Write" and "Read" by using "set name". I know you can't use Read and Write as proc names because of the conflict with datum.Read() and datum.Write(), but you can make the verbs come out that way on the user's end.

Lummox JR
In response to Lummox JR
Lummox JR wrote:

If I were you I'd shorten those verbs to "Write" and "Read" by using "set name".

Personally, I'd also shorten "Pickup" to "get", as many players already have macros set up for "get". (Besides, it's shorter for us lazy typers. :P )
In response to Crispy
Crispy wrote:
Personally, I'd also shorten "Pickup" to "get", as many players already have macros set up for "get". (Besides, it's shorter for us lazy typers. :P )

True; I didn't mention it because I figure it's a preference issue. Most people do think in terms of "get" and "drop", though.

Lummox JR