ID:150380
 
Hello its me kalzimere. I have been working hard on trying to get the Click() verb to work with an obj. I have gone through many hours and talked to many friends but for some reason in game it doesn't work the code compiles good no errors not even a warning heres the code any help is deeply apreciated.

hackseat1
icon_state = "hackseat1"
name= "Hacker Chair"
density = 1
Click()
set src in view(4)
var/hacseat1answer = input("What do you wish to be hooked into to?") in list ("|Hack into the matrix|","|Sparing Program|","|Item Upload Program|","Cancel")
if(hacseat1answer == "|Hack into the matrix|")
usr.loc = locate("hacmatenter")
if(hacseat1answer == "|Sparing Program|")
usr.loc = locate("hacsparenter")
if(hacseat1answer == "|Item Upload Program|")
usr.loc = locate("hacitement")
if(hacseat1answer == "Cancel")
return
..()
Asume its compiles right cause it does ^^
-kalzimere
What exactly doesn't work?

And, you can't use 'set src in' for procs, that only works for verbs. Instead try something like this:

Click()
if (get_dist(src,usr) <= 4)
// do the stuff
In response to Foomer
You are wrong. Set src works in procs.
In response to Lord of Water
only for procs used as verbs :oP
In response to Foomer
the thing that doesn't seem to be working is that when you walk up to the chair and click it nothing happens. I clicked and click and no menu poped up lol. Would changing the src help. Well i got to gokinda late ill take a look here again in the morning. Thanks for the response so far any other help is deeply apreciated.
-kalzimere
src.sarcasm("Just what BYOND needs! A "The Matrix" game!")

Ya know, "Conker's Bad Fur Day" had a really good spoof of The Matrix. If you havn't played it, play it. It was good!
In response to Lord of Water
You wrote out src.sarcasm incorrectly. You would have gotten the following error:

error: The Matrix: missing comma ',' or right-paren ')'
error: wer: expected end of statement
error: ): expected }
error: location of top-most unmatched {

You should be aware of such flawed code in the future. The way it SHOULD have been written is as follows:

src.sarcasm("Just what BYOND needs! A /"The Matrix/" game!")

In response to Foomer
Thanks for the code help, Foomer. My sarcasm proc can always be improved upon...
In response to Lord of Water
You're welcome :oP
Looks like you need to direct the input to prompt usr. Check "input" in the docs.

-James