Search the web
Sign In
New User? Sign Up
nakedmud · NakedMud Developer's Group
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
making mobs trigger on specific text?   Message List  
Reply | Forward Message #1668 of 1721 |
Re: [nakedmud] making mobs trigger on specific text?

Tyler,

Not sure if anything has changed recently and I am at work so cannot really check, but as it stood there wasn't a way to do this prior. Rooms have a function (room.add_cmd()) that you can call to add a specific command to each room. If your mob is stationary or only teaches in this room it would be a good idea to use that. You could just put a simple check on the room command to make sure the mob is in the room first, and deny if not.
 
If your Mob wanders, than that is a different story. Without modifying the source code, you could just set up a self enter and self exit trigger on the mob, when these triggers are called, just have it call add_cmd() on the mobs current room, and then when it exits have it remove_cmd()..
 
Now the issue with this is I'm not sure how the command handler reacts if you have multiple. Maybe Geoff can bust in and answer this, or you can wait until I get home and check.. What happens if you have 2 mobs, each one defines a room command for "teach". The remove_cmd removes commands from the master table, so which teach would be removed? Unsure. Haven't tested it. :o)
 
It might not be an issue at all, and if you could get room.remove_cmd() in then it definitely wouldn't be. If you need to add to the source code, then you might as well modify the command handler and py* files to allow objects and chars to have commands added to them.
 
Kevin


 
On Wed, Jun 17, 2009 at 2:59 PM, Tyler Littlefield <tyler@...> wrote:
Hello,
I know it's possible to add a speech hook, but is it possible to add
something like "teach me *" and let the * be set for whatever it wants?
If not, how hard would it be to set a command on a mob?
All of this would be done via python, if that helps.


Thanks,
Tyler Littlefield
Web: tysdomain.com
email: tyler@...
My programs don't have bugs, they're called randomly added features.



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
   http://groups.yahoo.com/group/nakedmud/

<*> Your email settings:
   Individual Email | Traditional

<*> To change settings online go to:
   http://groups.yahoo.com/group/nakedmud/join
   (Yahoo! ID required)

<*> To change settings via email:
   mailto:nakedmud-digest@yahoogroups.com
   mailto:nakedmud-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
   nakedmud-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
   http://docs.yahoo.com/info/terms/




Wed Jun 17, 2009 7:46 pm

lucky_tim01
Offline Offline
Send Email Send Email

Forward
Message #1668 of 1721 |
Expand Messages Author Sort by Date

Hello, I know it's possible to add a speech hook, but is it possible to add something like "teach me *" and let the * be set for whatever it wants? If not, how...
Tyler Littlefield
tyler@...
Send Email
Jun 17, 2009
7:00 pm

Tyler, Not sure if anything has changed recently and I am at work so cannot really check, but as it stood there wasn't a way to do this prior. Rooms have a ...
Kevin Morgan
lucky_tim01
Offline Send Email
Jun 17, 2009
7:47 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help