|
Muppet1856 Newbie
Joined: 16 May 2007 Posts: 6
|
Posted: Fri May 18, 2007 5:04 pm
AutoMap Question - w/Sample Prompt,Room Title, Desc, and Exit Lines |
I cannot get the Room Title to work, nor the Description or the Exits. Grrr.... A little help?
Typical Text for a room:
Code: |
[8PM|10/10P 10/10M|#1(0/0)#2(0/0) 400000 Nuyen NA]$%e[0m%e[1;36mWelcome to Awakened Worlds!%e[0m%e[0m
%e[0m Welcome to Awakened Worlds. This room stands on the event horizon of a great
rift, the rift connecting our world to that which lies beyond. You stand now
at the sole entrance to this realm. As you explore these hallowed halls, you
will discover everything you need to know to survive in the cruel, cold world
the Earth has become in what is our present - midway through the 21st century.
Mind you, here you will only be taught the theory of what you must do. Living
long enough to learn how to apply it is completely up to you. Welcome, and
good luck.
%e[0m%e[0;36mObvious exits:
%e[0m%e[0;36mNorth - All About Your Surroundings
%e[0m
[8PM|10/10P 10/10M|#1(0/0)#2(0/0) 400000 Nuyen NA]$%e[0m |
My Prompt code looks like this:
Code: |
#CLASS {System|Prompt}
#VAR Ammo_1 {0} {0}
#VAR Ammo_2 {0}
#VAR Capacity_1 {0}
#VAR Capacity_2 {0}
#VAR Nuyen {400000}
#VAR Condition {NA}
#VAR Time {2AM} {0}
#VAR Physical {10}
#VAR PhysicalMax {10}
#VAR Mental {10}
#VAR MentalMax {10}
#TRIGGER {^~[&Time~|&%d{Physical}~/&%d{PhysicalMax}P &%d{Mental}~/&%d{MentalMax}M~|~#1~(&%d{Ammo_1}~/&%d{Capacity_1}~)~#2~(&%d{Ammo_2}~/&%d{Capacity_2}~) &%d{Nuyen} Nuyen &Condition~]~$} {
#GAG
#SHOW $
} "" {prompt}
#BUTTON 1 {@Physical/@PhysicalMax P} {} {} {} {@Physical} {} {} {} {} {} {} {} {} {47} {} {Gauge||4|@PhysicalMax|@PhysicalMax/3|0} {} "" {Explore|Inset} {} {Physical}
#BUTTON 2 {@Mental/@MentalMax M} {} {} {} {@Mental} {} {} {} {} {} {} {} {} {111} {} {Gauge||4|@MentalMax|@MentalMax/3|0} {} "" {Explore|Inset} {} {Mental}
#BUTTON 3 {Left Hand @Ammo_2/@Capacity_2} {} {} {} {@Ammo_2} {} {} {} {} {} {} {} {} {11} {} {Gauge||12|@Capacity_2|@Capacity_2/5|7} {} "" {Explore|Inset} {} {Ammo_2}
#BUTTON 4 {Right Hand @Ammo_1/@Capacity_1} {} {} {} {@Ammo_1} {} {} {} {} {} {} {} {} {11} {} {Gauge||12|@Capacity_1|@Capacity_1/5|7} {} "" {Explore|Inset} {} {Ammo_1}
#CLASS 0 |
And my room script looks like this:
Code: |
#CLASS {System|Room}
#VAR RoomTitle {Welcome to Awakened Worlds!}
#VAR RoomDesc {All About Your Surroundings}
#VAR ExitBlock {North - All About Your Surroundings}
#VAR LastLine {%e[0m*} {%e[0m*}
#TRIGGER "MarkRoomTitle" {%e[1;36m&{RoomTitle}%e[0m%e[0m$} {#TAG name @RoomTitle} "" {prompt|color}
#COND {^%e[0m&{RoomDesc}$} {#TAG descpara @RoomDesc} {color}
#COND {^&{RoomDesc}$} {#IF (@LastLine = @RoomDesc) {#SET MarkRoomTitle 4 1} {#TAG descpara @RoomDesc}} {looplines|param=99}
#COND {} {
#NOOP
#ECHO WARNING!!!!
#SET MarkRoomTitle 4 1
}
#COND {} {#STATE MarkRoomTitle 0} {manual}
#TRIGGER "MarkExitBlock" {^%e[0m%e[0;36m&ExitBlock$} {#TAG exitpara @ExitBlock} "" {prompt|color}
#CLASS 0 |
|
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Sat May 19, 2007 4:03 am |
Firstly, is there a way to set the server-side word wrapping length to 0 or off? If so then that makes capturing the description a doddle. If there's not, then perhaps you should consider not capturing the description at all. I personally don't capture room descriptions simply because I don't need them and I often play with them off anyway. If you don't try to tag the description, your job becomes considerably easier.
Your example room text seems to have become a bit jumbled. I'd assume that the first line there has a line break after the %e[0m and that the exit line breaks are actually between the %e[0m and the %e[0;36m that follows. If that's wrong, then not only is your MUD doing something seriously funky with their ANSI colour codes, but these suggestions won't work. All that said:
#trig "RoomCapture" {%e[1;36m(*)%e[0m%e[0m} {#tag name %1;RoomExits=""} "" {color}
#cond {^%e[0;36mObvious exits: %e[0m$} {} {color}
#cond {^%e[0;36m(%w) - (*)%e[0m$} {#additem RoomExits %1} {looplines|param=10}
#alias ParseExitList {#tag exit %expandlist(@RoomExits,",");#state RoomCapture 0}
Add a call to the ParseExitList alias (or just the command it calls) to your prompt trigger. Also, does the RoomCapture trigger really need the prompt option to fire properly? |
|
|
|
Muppet1856 Newbie
Joined: 16 May 2007 Posts: 6
|
Posted: Sat May 19, 2007 11:09 pm |
ALAS, you are correct. They are indeed doing something funky... :(
|
|
|
|
Muppet1856 Newbie
Joined: 16 May 2007 Posts: 6
|
Posted: Tue May 22, 2007 8:04 pm |
Any Help?
|
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Tue May 22, 2007 9:09 pm |
What you need to do is take an ANSI log of the room (turn on ANSI colour logging and walk around a bit) and then upload the log somewhere and give us a link. That'll preserve the text and codes exactly as it appears to CMUD's ANSI trigger processing and let us give better suggestions.
|
|
|
|
Muppet1856 Newbie
Joined: 16 May 2007 Posts: 6
|
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Tue May 22, 2007 10:25 pm |
#trig "RoomCapture" {%e[1;36m(*)%e[0m} {#tag name %1;RoomExits=""} "" {color}
#cond {^%e[36mObvious exits: %e[0m$} {} {color}
#cond {^%e[36m(%w) - (*)%e[0m$} {#additem RoomExits %1} {looplines|param=10}
#alias ParseExitList {#tag exit %expandlist(@RoomExits,",");#state RoomCapture 0}
Try that instead. I'm not sure how you got that first example, but CMUD strips the colour codes when the line is recieved from the MUD and then reconstructs the codes from the colours that're actually drawn when the lines are shown. It's designed so that MUDs can't put random codes inside messages and break your triggers, and it looks like the client's stripping many of the extra codes there. |
|
|
|
|
|