ID:268690
 
I made it where you ask the NPC questions but on 1 button "You must be really olf to know all this" the NPC continues about that exact subject and you also so continue it by getting 2 new buttons 2 click but i can't get it to work .

mob
NPC
Red_Haired_Woman
icon='Mobs.dmi'
icon_state="Red Haired Woman"
verb
Talk()
set src in oview(1)
set name="Talk"
set desc="Talk"
set category="Commands"
switch(input("What would you like to know?")in list("The Beach","This Town","Merchants","You must be really old to know all this","Cancel"))
if("The Beach")
usr<<"The Beach lies to the east but recently krabs and other monsters have been showing up.The krabs stayed behind at the beach but no one knows where the other monsters went."
if("This Town")
usr<<"No one here remembers anything about this town or island.Most of the elders here say that there is one place that holds all our questions but we don't know where it is."
if("Merchants")
usr<<"Here is a tip . Merchants in towns sell there items at low prices but merchants outside of towns sell there items for twice the price."
if("You must be really old to know all this.")
usr<<"I am not old."
switch(input("Ok...")in list("...sorry.","...sorry but how do you know all this."))
if("...sorry.")
usr<<"It's ok"
if("...sorry but how do you know all this.")
usr<<"Ummm I lsten in on the elder's conversations"
Uh, just to save you in the future.
Make the verb, "talk", be Talk(mob/M), and replace every user with M
In response to Hell Ramen
ok but what do i do about this problem .
I think, I THINK, this is what you're trying to do:

If you select:

"You must be really old to know all this"

You want it to switch input you again but with two more options right?

One way to do it is if they select that first option, create a brand new switch input with the two more options in it, like so:

                    switch(input("What would you like to know?")in list("The Beach","This Town","Merchants","You must be really old to know all this","Cancel"))
if("The Beach")
usr<<"The Beach lies to the east but recently krabs and other monsters have been showing up.The krabs stayed behind at the beach but no one knows where the other monsters went."
if("This Town")
usr<<"No one here remembers anything about this town or island.Most of the elders here say that there is one place that holds all our questions but we don't know where it is."
if("Merchants")
usr<<"Here is a tip . Merchants in towns sell there items at low prices but merchants outside of towns sell there items for twice the price."
if("You must be really old to know all this.")
usr<<"I am not old."
switch(input("Ok...")in list("The Beach","This Town","Merchants","...sorry.","...sorry but how do you know all this.","Cancel"))
if("The Beach")
usr<<"The Beach lies to the east but recently krabs and other monsters have been showing up.The krabs stayed behind at the beach but no one knows where the other monsters went."
if("This Town")
usr<<"No one here remembers anything about this town or island.Most of the elders here say that there is one place that holds all our questions but we don't know where it is."
if("Merchants")
usr<<"Here is a tip . Merchants in towns sell there items at low prices but merchants outside of towns sell there items for twice the price."
if("...sorry.")
usr<<"It's ok"
if("...sorry but how do you know all this.")
usr<<"Ummm I lsten in on the elder's conversations"


Another, less space taking method, would be to make the switch input choose from an actual list and then add things to the list and then switch input again.

            verb
Talk()
set src in oview(1)
set name="Talk"
set desc="Talk"
set category="Commands"
var/list/options = list("The Beach","This Town","Merchants","You must be really old to know all this","Cancel") // the magical list with all the options, we can add and remove options inside of our options list variable.
retry//loopable point
switch(input("What would you like to know?")in options) //choose from the list variable defined above
if("The Beach")
usr<<"The Beach lies to the east but recently krabs and other monsters have been showing up.The krabs stayed behind at the beach but no one knows where the other monsters went."
if("This Town")
usr<<"No one here remembers anything about this town or island.Most of the elders here say that there is one place that holds all our questions but we don't know where it is."
if("Merchants")
usr<<"Here is a tip . Merchants in towns sell there items at low prices but merchants outside of towns sell there items for twice the price."
if("You must be really old to know all this.")
usr<<"I am not old."
options.Add("...sorry.") //add a new option into the list
options.Add("...sorry but how do you know all this.")
options.Remove("You must be really old to know all this.") //stop them from choosing this option again.
goto retry //loop them to the retry point added above.
if("...sorry.")
usr<<"It's ok"
if("...sorry but how do you know all this.")
usr<<"Ummm I lsten in on the elder's conversations"


I feel option 1 is better since goto is considered a bad habit and i feel that i have more control with option 1.
In response to Hell Ramen
Hell Ramen wrote:
Uh, just to save you in the future.
Make the verb, "talk", be Talk(mob/M), and replace every user with M

I think you're a little confused, this isn't a player verb. This verb belongs to another object (the NPC), and is one of the few places you have to use usr.
switch(input("blah")in list("blah","You must be really old to know all this","blah"))

if("You must be really old to know all this.")


See the difference? =)

There is a period in one of those, the have to be exactly the same.
In response to YMIHere
YMIHere wrote:
Hell Ramen wrote:
Uh, just to save you in the future.
Make the verb, "talk", be Talk(mob/M), and replace every user with M

I think you're a little confused, this isn't a player verb. This verb belongs to another object (the NPC), and is one of the few places you have to use usr.

Wouldn't M work better?
In response to Hell Ramen
It'd work the same i believe.
In response to Hell Ramen
No, he has it set-up a different way. It's just like an object verb only it's attached to a mob instead. If he used mob/M it would prompt him to pick a mob, but he doesn't need the prompt because src is the mob he wants to talk to. =)

He could make a basic Talk(mob/M in view(src,1)) verb for players where they would always have the verb, but it would only work if there was a mob in view to talk to. The way he currently has it the verb will only show up when near the mob.

obj/apple/verb/Get()
set src in view(1)
usr << "You grabbed the apple."
del src


It's basically the same as that. I could add a parameter (Get(obj/apple/A)), but it would be useless since it is already src and usr is the guy who picked it up.

*Edit
Maybe I should add that since src is the object (not to be confused with /obj) that the verb belongs to (the NPC) you have to use usr (the thing that started the call stack {the player who clicked the verb}) in this instance.