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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
HerenIstarian
Novice


Joined: 30 Oct 2005
Posts: 40

PostPosted: Thu Sep 01, 2011 10:37 am   

#Tags and Mapper Trouble
 
First of all here is my MUD output:


HP:100% 1972/1972 CP:100% 695/695 >>
-[ Giedi Prime Astro Port ]-
Giedi Prime Spacing Guild Astroport. Several low buildings surround
a landing pad here. One building has a display terminal
unit on it all the rest of the buildings are sealed.
You are in Giedi Prime's astroport. There's crowds of
people everywhere and you wonder where they are all going.
To the west is the crossroads to Giedi Prime. To the east
is the entrance to the Newbie Hospital. North lies a military camp.

Seven obvious exits: southeast, southwest, northeast, north, south, west and
east.
An automatic bank teller machine
Imperial Shuttle
A signpost
*Grilled slice of Wurm
Olavi The Master Assassin (Tleilaxu)
A top killer list
HP:100% 1972/1972 CP:100% 695/695 >>

I have tagged the room name and exits and prompt like so:
Exits:
#TRIGGER {* obvious exits: (*)} {#TAG exitpara {%1}}
#TRIGGER {* obvious exit: (*)} {#TAG exit {%1}}
Room Name:
#TRIGGER {-~[(*)~]-} {#TAG name {%1}}
Prompt:
TRIGGER {HP:&hpp~% &hp~/&mhp CP:&cpp~% &cp~/&mcp ~>~>} {#TAG prompt;#gag}

When configuring the mapper everything checks out. 2 Things happens:
1. With autoprompt detect on or without tagging the prompt it will create a room using the exits of the last room I was in. Some times it will take me 'look'ing before the room is created or sometimes the room will be created on entering or even exiting.

2. With autoprompt detect off and the prompt tagged it does not attempt to create a room at all. I have tried reconfiguring several times I have been messing with this awhile. I know the prompt trigger works because it is gagged but it does not seem to be reading the prompt as the prompt. It does, however, detect me moving about rooms already created.

Anyone have any ideas why this would be happening?
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Thu Sep 01, 2011 8:25 pm   
 
You need to make the prompt trigger TRIGGER ON PROMPT.
Reply with quote
HerenIstarian
Novice


Joined: 30 Oct 2005
Posts: 40

PostPosted: Thu Sep 01, 2011 10:52 pm   
 
When I set it to Trigger on Prompt it still doesn't work and the trigger no longer gags the prompt.
Reply with quote
HerenIstarian
Novice


Joined: 30 Oct 2005
Posts: 40

PostPosted: Sun Sep 04, 2011 4:59 am   
 
I hate bumping something but I have been trying all kind of triggers and options and everything I can think of but nothing really changes. Why would Trigger on Prompt not be working?
Reply with quote
geniusclown
Magician


Joined: 23 Apr 2003
Posts: 358
Location: USA

PostPosted: Sun Sep 04, 2011 1:13 pm   
 
I would like to help you, but I've been having only limited success with using #TAG to work with the mapper. Only thing that stands out to me is to change
Code:
#TRIGGER {* obvious exits: (*)} {#TAG exitpara {%1}}
#TRIGGER {* obvious exit: (*)} {#TAG exit {%1}}


...to...

Code:
#TR {*obvious exit{|s}: (*)} {#TAG exit %1}


You may also want to throw in some debugging lines like:
Code:
#TR {*obvious exit{|s}: (*)} {#TAG exit %1;#ECHO -- Captured %1 ... Mapper Exits: %roomexit}

to see if it's capturing correctly, or at all. (note: %roomexit will show the internal directions, using hjkl instead of nw, ne, sw, and se)

Something else that occurs to me: in your quote from the game above, the lines are wrapping due to CRs rather than the browser wrapping long lines. Does the MUD use CRs liberally, or is that just how it pasted? Look at the mapper's Configuration Settings. What does the "Exits start line" show? If the MUD is not sending all these extra CRs, then the exits should start on line 2 (line zero being the room name, line one being the description), but if the exits start on, say line 9, then it's seeing and counting each line of the description, and it will only match for rooms that have exactly 8 lines of description. I don't know the solution to this, but it may be using the paragraphs? Someone else may know better.

But then, being a huge fan of Dune, I just may pop over and check out that MUD one of these days.
_________________
.geniusclown
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Sep 04, 2011 3:36 pm   
 
The more you tag, the more you can ignore the autoconfiguration issues. Two multi-state triggers and the prompt trigger should do the trick here to capture it all.

1)room name and room description

Use your room name trigger as state 0, though I personally would include ^ and $ to cut down on any potential matches (ie, you don't want your room name trigger to fire if a player is giving a room name via chats). You will want to include lines that reset your room variables, as well, so you never end up tagging outdated stuff.

#trigger "tRoomName" {^-~[(*)~]-$} {
//use variables to store your info for later tagging
RoomName = %1
RoomDesc = ""
}
#condition {^(%w*)} {
//this captures the room desc and keeps this state active until you hit a blank line
#if (@RoomDesc) {RoomDesc = %additem(%1,@RoomDesc)} {RoomDesc = %1}
#tRoomName 1
} {WithinLines|param=1}

3)room exits and items/people

There is a limitation with the use of the Within Lines trigger state type as shown above wherein an unfired and expired Within Lines state will not advance to further states (the trigger gets reset to state 0 instead). This being the case, we have to then use a second multi-state trigger to capture the exits and items/people.

#trigger "tRoomExits" {^%w exit{s|}: ([%w%s,.])$} {
RoomExits = %1
RoomItemsPeople = ""
}
#condition {(*)} {
#if (@RoomItemsPeople) {RoomItemsPeople = %additem(%1,@RoomItemsPeople)} {RoomItemsPeople = %1}
#state tRoomExits 1
} {WithinLines|param=1}

3)prompt

#trigger {your pattern here} {
#tag name @RoomName
#tag desc %expandlist(@RoomDesc,%cr)
#tag exit @RoomExits
#tag prompt
}
_________________
EDIT: I didn't like my old signature
Reply with quote
HerenIstarian
Novice


Joined: 30 Oct 2005
Posts: 40

PostPosted: Sun Sep 04, 2011 8:01 pm   
 
Thanks that really helped and taught me a lot. I was able to tweak it a bit to get it working but the description ends up being all the items/mobs in a room and the room name ends up being the exits, as long as its mapping that's fine because I don't absolutely need those. I do have 3 questions though.

1. The prompt doesn't seem to gag with #gag in the trigger with Trigger on Prompt on, is there anyway to get the gag to work.

2. This setup seems to cause a lot of lag, should I disable the triggers when I'm not mapping?

3. What should I do if there is not a blank space between the description and the exits?
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Sep 04, 2011 8:50 pm   
 
One thing you can do is switch the WithinLines states to Manual types. When you do this, you have to test the currently-matched line for a reset condition because as the name implies it's not going to change states automatically. This, of course, will clean up the script a bit and should make it less laggy AND more guaranteeable in the order of processing.

#trigger "tRoomInfo" {room name pattern} {stuff}
#condition {(*)} {
#if (%match(%1,"obvious exit{s|}: (*)",$exits)) {
RoomExits = $exits
#state tRoomInfo 2
} {
RoomDesc = %additem(%i,@RoomDesc)
}
} {Manual}
#condition {prompt pattern} {
#tag name @RoomName
#tag desc %expandlist(@RoomDesc,%cr)
#tag exit @RoomExits
#tag prompt
} {nocr|prompt}
_________________
EDIT: I didn't like my old signature
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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