obj/sign/var/signed = ""
obj/sign
icon = 'door.dmi'
icon_state = "sign"
density = 1
signed = "The sign is blank."
verb
Read_Sign()
set src in oview(1)
usr << "[signed]"
mob/verb
Build_Sign(C as text)
set category = "Objs"
if(src.can_build == 1)
new/obj/sign(usr.loc)
o.signed = "[C]"
else
src <<"Can't build here."
^ Thats the code.. soo.. how do i get it so that when you build a sign you can set the 'signed' variable so that other people can read what the sign says?
I tried 'signed = "[C]"
and o.signed="[C]"
but none of those worked.
Thanks so much ^^
-Cait
ID:261897
Dec 26 2003, 11:24 am
|
|
In response to Wanabe
|
|
It works!!!
i have no clue how.. but it works!!! anyways heres part 2 of it.. obj/sign/var/signed = "" obj/sign icon = 'door.dmi' icon_state = "sign" density = 1 signed = "The sign is blank." verb Read_Sign() set src in oview(15) usr << "[signed]" mob/verb Build_Sign(M as mob) set category = "Objs" if(src.can_build == 1) var/obj/sign/o = new/obj/sign(usr.loc) var/C = input ("What do you want the sign to say?") o.signed = "[C] - [usr]" else src <<"Can't build here." ^ How do i make it so the persons name goes under what they say? I tried '[usr]' but that puts the name of who REAds it.. Thanks again! ^^ -Cait |
In response to Mashed_The_Hamster
|
|
Mashed_The_Hamster wrote:
It works!!!- [usr]" else Make another variable for the sign called "owner" and set its owner to the person that wrote its name, then display it when you use the read verb. |
In response to Wanabe
|
|
Wanabe wrote:
Make another variable for the sign called "owner" and set its owner to the person that wrote its name, then display it when you use the read verb. Alternatively, you could add "\n-[usr]" to C before the o.signed=C line. \n is the new line text macro (see that? That's a link). Also, the <code>var/obj/sign/o = new/obj/sign(usr.loc)</code> line is redundant. All you need is <code>var/obj/sign/o = new(usr.loc)</code> Oh, and finally, put <DM> before and </DM> after your code when posting on the forums. It makes it easier to read. |
In response to Garthor
|
|
eh..
fire emblem helped me w/ this one too all it was was [src] XD im stupid. o wel, yeah that owner varaible was somethign i need.. i posted a topic about it somewhere but i cant find it *Goes to search* |
First of all your using o.signed?? What is o??? I dont see any thing in there that talks about o.
Also you do your verb like this:
mob/verb
Build_Sign(C as text)
set category = "Objs"
if(src.can_build == 1)
new/obj/sign(usr.loc)
o.signed = "[C]"
else
src <<"Can't build here."
The way that verb will work, is they will type their message THEN it will check if they can build, why like that?? :P
This is how it could be created:
var/obj/sign/o = new/obj/sign(usr.loc)
o.signed = C
I hope this helps.