ID:150222
 
Ok inside my Bump I'm trying to call the Tell verb.
The code listed below works enough to get me a
Guest tell you,

But thats it, no msg part. And yes I've tried Tell(M,msg as text) but that gives me msg bad var on compile.
I go the who and to part working with M in there, but I need to poll for the message so thats added in there as well. Any ideas?

mob/pc
Bump(mob/M as mob)
if(M.typechar == "pc" && bumpmode == "Talk")
Tell(M)

Also I'll provide the Tell code I'm calling....
mob/pc/verb
Tell(M as mob in world, msg as text)
set category = "Communication"
M << "\icon[usr] [usr] tells you, [msg]"

If you'll notice this is just another way of calling the mob/pc/verb/Tell()

Also trying Tell(M,(text))
Gives this strange result-> Guest tells you, m

LJR
LordJR wrote:
Ok inside my Bump I'm trying to call the Tell verb.
The code listed below works enough to get me a
Guest tell you,

But thats it, no msg part. And yes I've tried Tell(M,msg as text) but that gives me msg bad var on compile.
I go the who and to part working with M in there, but I need to poll for the message so thats added in there as well. Any ideas?

mob/pc
Bump(mob/M as mob)
if(M.typechar == "pc" && bumpmode == "Talk")
Tell(M)

Also I'll provide the Tell code I'm calling....
mob/pc/verb
Tell(M as mob in world, msg as text)


Try taking the as mob in world out of that, and changing it to mob/M //with on in ot as.
In response to Nadrew
mob/pc/verb
Tell(M as mob in world, msg as text)


Try taking the as mob in world out of that, and changing >it to mob/M //with on in ot as.

Say what!? I tried some variation of what I thought you were trying to get out and it ended up giving the input box to the person you were telling to, so they choose what u said to them.. Anyways that wasn't even an answer to my question. I changed it back to the way I had it and I tried some of my own guess-work-experimental code and got it to work, now I have a few question about why the "m" is on the dialog box above the input, and below the Title bar??
Here is the code that when u bump into a pc it gives u a blank dialog box except for the mystery "m" and sends that tell to the person. What I'd like to do now is get rid of that m and also put on the Title bar for the dialog box, Tell [M]. Which kind of ties into my other dialog box formating question, but this one uses input.

This is the section of code that calls the verb that got it working. Learn anything?

mob/pc
Bump(mob/M as mob)
if(M.typechar == "pc" && bumpmode == "Talk")
Tell(M,input(M))

BTW, this works, just with a blank dialog box which I now need to know how to decorate up. Can anyone list me the basic setup/format for change what/where on the input and other dialog boxes?

LJR
LordJR wrote:
Ok inside my Bump I'm trying to call the Tell verb.
The code listed below works enough to get me a
Guest tell you,

But thats it, no msg part. And yes I've tried Tell(M,msg as text) but that gives me msg bad var on compile.
I go the who and to part working with M in there, but I need to poll for the message so thats added in there as well. Any ideas?

Input the message before invoking Tell():

mob/pc
Bump(O)
if(ismob(O))
var/mob/M = O
if(M.typechar == "pc" && bumpmode == "Talk")
var/msg = input(src,"What would you like to tell [M]?","Tell [M]") as text
Tell(M, msg)

Using Bump(mob/M as mob) will not filter out non-mobs, since the Bump prototype allows non-mob atoms to be Bump()ed. I changed it from Bump(mob/M as mob) to Bump(O) and test for mob state because if you bump into non-mob atoms, it will try to process them as a mob and force them through the code. Square pegs in round holes makes for lots of pretty red runtime errors.

Also I'll provide the Tell code I'm calling....
mob/pc/verb
Tell(M as mob in world, msg as text)
set category = "Communication"
M << "\icon[usr] <font color=blue>[usr]</font> tells you, <font color=blue>[msg]</font>"

You should use src instead of usr in your tell code. Since Bump() does not set usr, you will get unexpected results when you run this in multiplayer. usr will be whoever last used a verb, and not the person bumping.
In response to Shadowdarke
Using Bump(mob/M as mob) will not filter out non-mobs, since the Bump prototype allows non-mob atoms to be Bump()ed. I changed it from Bump(mob/M as mob) to Bump(O) and test for mob state because if you bump into non-mob atoms, it will try to process them as a mob and force them through the code. Square pegs in round holes makes for lots of pretty red runtime errors.
Hmm I'll give this a try, right now I also have the Bump only react to certain chartypes.


You should use src instead of usr in your tell code. Since Bump() does not set usr, you will get unexpected results when you run this in multiplayer. usr will be whoever last used a verb, and not the person bumping.

ah I see.. ok I'll give this a try... I'm like a monkey with a hammer I have the tool, but not always sure how best to use it to hit the nail on the head! ;) Thanks

LJR