Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Phlux
Beginner


Joined: 26 Sep 2005
Posts: 14

PostPosted: Tue Oct 18, 2005 6:23 pm   

"Can't move there" message detection
 
I think I posted this once before, but I can't find the post anywhere so I can't see if anyone responded.

Is there a way to make zMUD detect a "you can't move in that direction" message and automatically issue a #nodir command?

The MUD I play has player created areas and they can customize their own messages for when players move in wrong direction. They can be up to 440 characters in length, but they are not quite the same as room descriptions.

The output in zmud looks something like this
n
>n
You can't move in that direction.

Whereas a room description would look like
n
>n
Room Title up to 64 characters
Room Description up to 1000 characters.

I only want such action to be triggered when I use a direction command, so that it doesn't get triggered when someone is talking to me, or when whatever location I'm in has some sort of text pop up at me.

Anyone ever done anything like this? I'm still fumbling my way through zmud scripting, but it seems to me that this might be possible.
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Tue Oct 18, 2005 7:57 pm   
 
This should do the trick.

Code:
#TRIGGER NoDIR {^You can't move in that direction. }{#nodir}
_________________
Asati di tempari!
Reply with quote
Phlux
Beginner


Joined: 26 Sep 2005
Posts: 14

PostPosted: Wed Oct 19, 2005 4:41 pm   
 
I have a trigger for that already. In this particular MUD the "you can't move in that direction." message isn't always the same. Players can create their own messages in player-created areas of the game. So in one zone it could be "You can't move in that direction." and the next room over it could be "You're an idiot and you just bumped into a wall."

Messages can and do vary from location to location. I am hoping there's a way to "detect" a message without necessarily knowing what it says, based perhaps on the formatting and the fact that it will be recieved after making a directional command.

New player areas are introduced into the game regularly, and it makes mapping a pain, because some players get really fancy and use 5 or 6 different messages. Basically I want a trigger that will realize I recieved only a single line of text after making a movement command, and then issue the #nodir command to prevent the map from moving.
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Wed Oct 19, 2005 5:36 pm   
 
Sorry to say, but not really. It's hard to trigger off something with out know what it is. The message could be anything. You can't really just match what happens after you move, because it could be a tick message like 'The sun set slowly in the west.' If you can have the message apply to some specfic formatting or rules, or perhaps always contain a particular keyword then you might be able to trigger on that. But since these are player created areas having that is unlikely.

You best bet is to do a list for each message in a particular area. Not necessarily the most elegant, but I don't think you have many other options.
_________________
Asati di tempari!
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Wed Oct 19, 2005 9:07 pm   
 
Closest thing I can think to do is capture every line after a direction is sent until a prompt is received. Then if only 1 line other then the prompt was received check it against existing triggers with %trigger("Text from line"). If it is 1 then a trigger for that text was already made and the script can stop. Otherwise it should dump the text into the command line with everything set for the user to make a #NODIR trigger by doing '#INPUT {%concat("#TR {^",@variableForTextFromLine,"$} {#NODIR};#NODIR")}'. This way if you approve the addition you can just hit enter, if not you can dump it very readily. You can look up a number of multiline capture solution that would handle this. There are also some shorter routes to go if you think the logic and method is sound. Of course it is always best to provide some samples of actual mud text if you want us to write it for you.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net