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
ID:177169
![]() Oct 21 2002, 6:50 am
|
|
SkylineR34 wrote:
mob/var/message Look over the first lines again: mob/var/message 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 |
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 |
SkylineR34 wrote:
ive changed it to this.. 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() 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() 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 |
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 ) |
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 |
usr is the last atom to take an action. In the case of a verb, it's always the mob using the verb.