Im trying to make it where you can write books.. Im wondering how i would make something like this happen:
obj/groupable/book
icon = 'objs.dmi'
icon_state = "book"
var
author = ""
story = ""
verb
Read()
usr << "[name] by [author]:"
usr << "[story]"
obj/special/study
icon = 'objs.dmi'
icon_state = "table"
name = "Study Table"
verb
Write_Book()
set src in view(1)
var/nm = input("Name?","Name?")
var/story = input("Story?","Story:")
new/obj/groupable/book(usr.loc)
src.name = nm
src.story = story
src.author = usr.name
That code doesnt work
Thanks
~Rcet
ID:150605
![]() Aug 22 2001, 9:10 pm
|
|
Rcet wrote:
Im trying to make it where you can write books.. Im wondering how i would make something like this happen: Write_Book() set src in view(1) var/nm = input("Name?","Name?") var/story = input("Story?","Story:") new/obj/groupable/book(usr.loc) src.name = nm src.story = story src.author = usr.name In the above section, Write_Book() belongs to obj/special/study, which means that src = the study, not the book. You are trying to set the name, story, and author of the study, when I believe you want to set it for the book you just created. var/obj/grouble/book/B = new(usr.loc) B.name = nm B.story = story B.author = usr.name See if that works instead. I'm only drinking half-caff today, so no promises. /mob/skysaw |
that should be it, you were pretty close, just needed the as text part