mob program problem

Posted by Warsong on Wed 30 Apr 2003 03:46 AM — 5 posts, 17,366 views.

#0
I'm having some trouble getting this mob program to work correctly. Here is the program:

type: rand_prog

Arg: 100

Command:
if Tell ($I) == dwarven daycare
mpechoat $r _whi The ground opens beneath you!
mpechoaround $r $r _whi disappears down a portal.
mpoload 21005 1
mptransfer $r 6601
mpat $r mpforce $r bounce
mpechoat $r _lbl You arrive at your destination with a thud!
else
mpechoat $r _whi I'm sorry but I don't understand what you are saying.
mpechoaround $r $r _whi is talking nonsense.
endif

Basically what I want to happen is a player tells the mob something (tell is the trigger), in this case dwarven daycare, and the program will first give a scroll of recall and the player, then take them to the desired location. I guess I am missing something because the program never triggers. What am I missing here?
Australia Forum Administrator #1
Don't you want a speech prog or something different than a rand_prog?
USA #2
Alright, this one is kinda odd so Ill be doing a LOT of quoting with inline comments to attempt to debug this so it works for you. Btw, I agree with Nick, you'll want the trigger to be something other than random given the way this is written. It is also of particular interest that morts cannot usually send tells directly to mobs into which an imm is not switched.
Quote:

type: rand_prog

Arg: 100

For starters, make this a speech prog to trigger on the name of the desired desitination.
Quote:

Command:
if Tell ($I) == dwarven daycare

Again, make note of the fact that morts typically cannot send tells to mobs unless an imm is switched into that mob so you'll probably need to just drop that line entirely. Also note that using $r below here selects a random target at every instance of $r, might explain why the prog never works even if you've recoded the do_tell function to allow morts to send tells to mobs.
Quote:

mpechoat $r _whi The ground opens beneath you!

mpechoat $n _whi ...
Quote:

mpechoaround $r $r _whi disappears down a portal.

mpechoaround $n $n _whi ...
Quote:

mpoload 21005 1
mptransfer $r 6601

mptransfer $n ...
Quote:

mpat $r mpforce $r bounce

mpat $n mpforce $n ...
Quote:

mpechoat $r _lbl You arrive at your destination with a thud!

mpechoat $n _lbl ...
Quote:

else
mpechoat $r _whi I'm sorry but I don't understand what you are saying.

mpechoat $n _whi ...
Quote:

mpechoaround $r $r _whi is talking nonsense.

mpechoaround $n $n _whi ...
Quote:

endif


Notice I never use $r in my commands. This is particularly important in transfer routines because the way you originally structured it, you would 99% of the time give the scroll to one 'person' in the room and transfer an entirely different 'person'. You may also want to add an ispc $n check to prevent you more 'brilliant' of your players from charming mobs and having them transfer themselves to newbie areas to kill the unsuspecting newbs later. Yes, Ive seen it done and no the 'creative genuis' behind the prank wasn't playing there after they were caught. anyway, try the changes I suggested and the prog should perform flawlessly.
USA #3
Alright, this one is kinda odd so Ill be doing a LOT of quoting with inline comments to attempt to debug this so it works for you. Btw, I agree with Nick, you'll want the trigger to be something other than random given the way this is written. It is also of particular interest that morts cannot usually send tells directly to mobs into which an imm is not switched.
Quote:

type: rand_prog

Arg: 100

For starters, make this a speech prog to trigger on the name of the desired desitination.
Quote:

Command:
if Tell ($I) == dwarven daycare

Again, make note of the fact that morts typically cannot send tells to mobs unless an imm is switched into that mob so you'll probably need to just drop that line entirely. Also note that using $r below here selects a random target at every instance of $r, might explain why the prog never works even if you've recoded the do_tell function to allow morts to send tells to mobs.
Quote:

mpechoat $r _whi The ground opens beneath you!

mpechoat $n _whi ...
Quote:

mpechoaround $r $r _whi disappears down a portal.

mpechoaround $n $n _whi ...
Quote:

mpoload 21005 1
mptransfer $r 6601

mptransfer $n ...
Quote:

mpat $r mpforce $r bounce

mpat $n mpforce $n ...
Quote:

mpechoat $r _lbl You arrive at your destination with a thud!

mpechoat $n _lbl ...
Quote:

else
mpechoat $r _whi I'm sorry but I don't understand what you are saying.

mpechoat $n _whi ...
Quote:

mpechoaround $r $r _whi is talking nonsense.

mpechoaround $n $n _whi ...
Quote:

endif


Notice I never use $r in my commands. This is particularly important in transfer routines because the way you originally structured it, you would 99% of the time give the scroll to one 'person' in the room and transfer an entirely different 'person'. You may also want to add an ispc $n check to prevent the more 'brilliant' of your players from charming mobs and having them transfer themselves to newbie areas to kill the unsuspecting newbs later. Yes, Ive seen it done and no the 'creative genuis' behind the prank wasn't playing there after they were caught. anyway, try the changes I suggested and the prog should perform flawlessly.
#4
You were right about the type of program, I had changed it to Speach_prog already. My inital thought was to only have one mob program to do all the stuff that I wanted. Afterwards I broke up the programs into smaller programs and triggered by a different speak phrase for each one. I had also noticed that $r was not working correctly as you had said. I changed them to $n and that fixed that. The programs look like this now:

if ispc($n)
mpechoat $n _whi The ground opens beneath you!
mpechoaround $r _whi $n disappears down a portal.
mpoload $n 21005 1
mptransfer $n 2467
mpat $r mpforce $r bounce
endif

The prog type is speach and the argument is the keywords that trigger the program. It works perfectly. Thanks for the help.