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


Joined: 12 Mar 2005
Posts: 195

PostPosted: Sun Mar 11, 2007 11:14 am   

Help wanted. How to input room description into mapper.
 
Ok, what I want to do is run an alias that will "look".

Then what will happen is any text after trigger "%e[1;33m(%1)%e[0m." will be added to a variable.

Then when the line "You notice*" (Which is the end of the description) is recieved it will add all the contents of the variable into the room description.

There is also line breaks in the description so i need something that will successfully shuve em all together into the variable

Thanks, been tryin to get this to work for ages!
Reply with quote
adamwalker
Apprentice


Joined: 12 Mar 2005
Posts: 195

PostPosted: Sun Mar 11, 2007 11:34 am   
 
what i do have.. but cant get it to work is....

state 1 %e[1;33m(%1)%e[0m.

#var myvar {}
#TEMP {*You notice {exits|a single}*} {
#noop %roomdesc( , @myvar)
#STATE myTrig 0
}

state 2 (*)

#addi myvar %line

which is all activated, and look entered, by an alias. all this worked (i think) in zmud
Reply with quote
adamwalker
Apprentice


Joined: 12 Mar 2005
Posts: 195

PostPosted: Sun Mar 11, 2007 11:39 am   
 
so this is how it happens...

I run an alias that activates the trigger and look is entered

%e[1;33mROOM NAME%e[0m. (or whatever) is recieved and the temp trigger is made
then the 2nd state adds ALL TEXT RECIEVED to @myvar.
then the temp trigger fires at the end of the text (you notice exits north etc).
The triggers are disabled and the %roomdesc is added to the current room on the map

but the problem seems to be is that the 2nd state doesnt actually fire....
Reply with quote
adamwalker
Apprentice


Joined: 12 Mar 2005
Posts: 195

PostPosted: Sun Mar 11, 2007 12:32 pm   
 
You will all be happy to know... i have done it!!!!! one final problem tho. heh.


to make it one long full description i need to delete the | separators.

What i get is

line one contents|line two contents|line 3 contents

what i need is
one contents line two contents line 3 contents

so this was my idea was this

myvarb = %subregex( %trim( @myvara), " ", "|")


but its causing cmud to freeze
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Sun Mar 11, 2007 1:27 pm   
 
myvara=%replace(@myvara, "|"," ")

Will replace | with spaces no need to use myvarb
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
Danlo
Magician


Joined: 28 Nov 2003
Posts: 313
Location: Australia

PostPosted: Tue Mar 13, 2007 12:02 pm   
 
You want it as one long line? I don't see the point, heh.
You might like this, though. If you want to be able to add multiline descriptions that are contained within your variable, you can use this:
#noop %roomdesc(%roomvnum(),%replace(@Myvar,"|","[%cr]"))
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