obj
thingy
Click()
set src in view(1)
I want to have it that if you click on the obj an alert shows up showing the verbs, so there are not so many statpanels. I have tried, but to no avail.
ID:168723
![]() Sep 5 2005, 8:14 am
|
|
Is it possible to have something like:
obj I want to have it that if you click on the obj an alert shows up showing the verbs, so there are not so many statpanels. I have tried, but to no avail. |
![]() Sep 5 2005, 8:48 am (Edited on Sep 5 2005, 9:03 am)
|
|
Seems I understood the problem wrong.
|
This is what I have come up with so far:
mob |
Um, that dir thing might not work correctly. You might want to try to typepath, or you can try src. I think src is the NPC in this case. You could also use Call() I realized.
|
No, the dir works correctly. I would've posted in code problems if that didn't work. But the problem with this coding is that I can click on him from anywhere, and he'll respond.
|
Try this.
mob/NPC/Click() Actually, thinking about it. You can use get_dist also. That might work better. if(get_dist(src,usr)==1) |
Popisfizzy wrote:
No, the dir works correctly. it may work correctly but you're doing it uncorrectly. O-matic |
Then whats the correct way (don't blame me for it being incorrect, I got it off of the forums. I'm not sure how to do it any other way).
|
Okay, that works.
Now I have another question: How would I make it so that "Talk" is added after "Pray To"? I don't want you to talk to the Deity until you've prayed to him. |
Well, you can make a list the NPC holds of people who prayed to him. If the mob prays, then you can add his key/name to the list. Have an if() check which sees if he is in the prayers list. If he is make the switch(input)) include Talk, if he doesn't don't include Talk. I know there is a more complex way to do this by adding to the list() or something, but I really don't know how to do that.
|
N1ghtW1ng wrote:
Um, that dir thing might not work correctly. You might want to try to typepath, or you can try src. in other words, use "src.dir" :). O-matic |
I wanted the seconds one. I tried, with no results. The other way could get messy because after that Talk opens up more verbs.
|
Okay, you can do this then:
mob/NPC I didn't exactly test this, there might be a problem with call(). |
Inter_Mobs.dm:111:error:list:undefined proc(#1 Error)
Inter_Mobs.dm:112::warning: operation has no effect here(#2 Error) Zehlihn |
Zehlihn That should work. |
Click() "var/a = input("What do you wish to do?","What do you wish to do?")in list(src.Options)" The problem is with that line, the problem hasn't anything to do with the options thingie (however you did need src in there). You just need to tab it-- it doesn't belong in the middle of an if statement one tab back. The compiler thinks thats the end of that if() statement. but it clearly isn't meant that way because the line under that if() statement is an extra tab, but I'm pretty sure that line is meant to belong to the if() statement. So the solution is either: tab that var line with the option thingie. Or put that line below the call() proc |