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
adamwalker
Apprentice


Joined: 12 Mar 2005
Posts: 195

PostPosted: Sat Dec 10, 2005 10:56 am   

Ansi Triggers and mapper conundrums
 
Follow on from this thread

http://forums.zuggsoft.com/phpbb/viewtopic.php?t=22631&start=0&postdays=0&postorder=asc&highlight=

I never found a way to add the descriptions to an already created room? anyone else got ideas.

but aside from that I decided to make the map from scratch... using #TAGs so it added the descriptions in the first place. a small problem im having is...

Quote:

The Even-tide has come; darkness will follow soon. The branches of the forest give sway here to a large open space, slightly grassed over. This field certainly has
not been used for quite awhile although this probably would mean that it was left to lie fallow for a year or two to regain its nutrients, ready to feed the
population of the nearest settlement.


See the problem? If I wanted to find a room with 'ready to feed the population' inside it the search wouldnt work because the mapper put a line break in cos of the muds output.

is there a way to remove/fix the linebreaks?

thanks again guys
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sat Dec 10, 2005 6:42 pm   
 
Yes, there's a way, but you are going to need to show the whole room output. There's no way to tell ZMud that "This is a room description." is any different from "This is not a room description." without some sort of context clues.

However, basically you will end up with a three-state trigger:

State 0: room name
State 1: room description
State 2: exits or prompt, depending on how your room output looks

State 0 will capture the name and other information that might appear on that line, and initialize the needed variables. State 1 will capture as much of the description as it can and enable a separate trigger to capture the rest (must be stored in a variable). Linebreaks can be removed at this stage using %concat(). State 2 will turn off that capture trigger and then #TAG all the information stored in the variables.

If you have extra lines that sometimes don't appear (ie, critters and items), you will probably want to create separate triggers for these and have the text removed from the description variable.
_________________
EDIT: I didn't like my old signature
Reply with quote
adamwalker
Apprentice


Joined: 12 Mar 2005
Posts: 195

PostPosted: Sat Dec 10, 2005 8:21 pm   hmmm
 
hey. i have gotten SO far with it doin it slightly different to how you suggest. this is my progress...


Code:
#TRIGGER "MultiTrig" {%e[1;33m(%1)%e[0m.} {
  #var roomvar {}
  #TEMP {*You notice*} {#STATE multiTrig 0}
  } "" {color}


and this seems to work. all the info is in @roomvar anyway. my problem now is i cant work out how to clear the current description to the current map room (that is selected by current position) then insert the contents of @roomvar

i assumed it would be as simple as

Code:
#ALIAS myalias {%roomdesc( , @roomvar)}


but that doesnt seem to do anything for me...

thanks again for your help
Reply with quote
adamwalker
Apprentice


Joined: 12 Mar 2005
Posts: 195

PostPosted: Sat Dec 10, 2005 8:41 pm   
 
update - tried
Code:
#noop %roomdesc( , @roomvar)
too without any luck. just does nothing
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Sat Dec 10, 2005 9:04 pm   
 
You have to be in mapping mode, or have the map unlocked. The below alias rewrite will save the mapper lock status, unlock it, and then relock it

#ALIAS myalias {
mapstate=%maplocked
#CALL %maplocked(0)
#CALL %roomdesc( ,@roomvar)
#CALL %maplocked(@mapstate)
}
_________________
Zmud Support Library
Zmud Knowledge Base
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