ID:163840
 
Hi there, in my game, I want to be able to right click a player and a list of verbs show up, the only way I know of doing this is adding mob/M in world in a verb title like so:

mob
verb
my_verb(mob/M in world)
//verb stuff


the only problem with this is that when I click this verb from a verb panel, I get a list with every mob in the world, how do I stop this list appearing and be able to create my own list?

I hope I've explained myself well enough and thanks in advance,

Farkas.
Farkas wrote:
mob
verb
my_verb()
var/list/L = list()
for(var/mob/M in world)
if(M.key) L += M
var/mob/target = input("Choose a mob with a client") in L
target << "You have been chosen by [usr]!"


the only problem with this is that when I click this verb from a verb panel, I get a list with every mob in the world, how do I stop this list appearing and be able to create my own list?

Keep in mind, this won't allow you to use the command line to choose a target, and you'll really only be able to choose a target based on it's name, but that should do what you're asking for.
In response to DerDragon
Thanks for replying, the only thing is this doesn't allow me to right click a mob and select the verb from the drop down list.
In response to Farkas
I've solved it, create two verbs and both call a proc:

mob/verb
Verb1(mob/M in world)
Proc1(M)
Verb2()
Proc1(null)
mob/proc
Proc1(mob/M)
if(M)
//If a Mob is given
if(!M)
//If no mob is given


Just thought i'd share if anyone else wanted to know how