Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ mob program problem

mob program problem

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Warsong   (11 posts)  Bio
Date Wed 30 Apr 2003 03:46 AM (UTC)
Message
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?
Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #1 on Wed 30 Apr 2003 10:42 AM (UTC)
Message
Don't you want a speech prog or something different than a rand_prog?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Meerclar   USA  (733 posts)  Bio
Date Reply #2 on Sat 03 May 2003 10:32 AM (UTC)
Message
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.

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
Top

Posted by Meerclar   USA  (733 posts)  Bio
Date Reply #3 on Sat 03 May 2003 10:33 AM (UTC)
Message
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.

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
Top

Posted by Warsong   (11 posts)  Bio
Date Reply #4 on Sat 03 May 2003 02:11 PM (UTC)
Message
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.
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


15,043 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.