Active Compass!

by Laysus

Back to Mechanic's Corner.

Laysus2006-09-05 20:21:14
I made this compass (graphic is shown in the bottom of the page - thanks to verithrax for the images). It updates from the display on entering a room, so not perfect (I don't use maps, so no point updating from anything else). To avoid being slow, it refreshes only the exits that change (i.e. if two consecutive rooms have north exits, the north arrow won't be refreshed). It's also rigged to refresh on prompt rather than the exits line itself to hide a bit of the lag from refreshing. There's also an alias CTM to turn it off. But no, I'm not giving out the graphics given I'm giving Veri credits for them. If you can find and rig up your own graphics to work with it, then use it, otherwise, neh tongue.gif

CODE

#CLASS {compass}
#TRIGGER "cmp_1line" {You see exits leading (*).$} {#var room.exitlist {%1};#var room.exitlist %replace({%replace({%replace({%replace({@room.exitlist}," ","")},"and","|")},",|","|")},",","|");#var room.exitlist %replace(@room.exitlist,"(opendoor)", "");#var room.exitlist %replace(@room.exitlist,"(closeddoor)", "");#var room.newon "";#var room.newoff ""}
#COND {%dh, %dm} {#priority {#forall @room.exitlist {#if (%ismember(%i,@room.lastexits)=0) {#additem room.newon %i}}};#priority {#forall @room.lastexits {#if (%ismember(%i,@room.exitlist)=0) {#additem room.newoff %i}}};#priority {#forall @room.newon {#noop %btnimage(cmp_%i,%i~_1~.bmp)}};#priority {#forall @room.newoff {#noop %btnimage(cmp_%i,%i~_0~.bmp)}};#if (%ismember(up,@room.newon) | %ismember(down,@room.newon) | %ismember(up,@room.newoff) | %ismember(down,@room.newoff)) {#noop %btnimage(cmp_ud,ud_%if(%ismember(up,@room.exitlist),1,0)%if(%ismember(down,@room.exitlist),1,0).bmp)};#if (%ismember(in,@room.newon) | %ismember(out,@room.newon) | %ismember(in,@room.newoff) | %ismember(out,@room.newoff)) {#noop %btnimage(cmp_io,io_%if(%ismember(in,@room.exitlist),1,0)%if(%ismember(out,@room.exitlist),1,0).bmp)};#var room.lastexits {@room.exitlist};#var room.exitlist ""} {within|param=1|nocr|prompt}
#TRIGGER "cmp_2line" {You see exits leading(*){^.}$} {#var room.exitlist {%1")"};#var room.exitlist %replace({%replace({%replace({%replace({@room.exitlist}," ","")},"and","|")},",|","|")},",","|");#var room.exitlist %replace(@room.exitlist,"(opendoor)", "");#var room.exitlist %replace(@room.exitlist,"(closeddoor)", "");#var room.exitlist %replace(@room.exitlist,"(open)", "");#var room.exitlist %replace(@room.exitlist,"(closed)", "");#var room.exitlist %replace(@room.exitlist,")", "");#var room.newon "";#var room.newoff ""}
#COND {(*).} {#var room.exitlist2 {%1};#var room.exitlist2 %replace({%replace({%replace({%replace({@room.exitlist2}," ","")},"and","|")},",|","|")},",","|");#var room.exitlist2 %replace(@room.exitlist2,"door)", "");#var room.exitlist2 %replace(@room.exitlist2,"(opendoor)", "");#var room.exitlist2 %replace(@room.exitlist2,"(closeddoor)", "");#var room.exitlist2 %replace(@room.exitlist2,"(open", "");#var room.exitlist2 %replace(@room.exitlist2,"(closed", "");#var room.exitlist %concat(@room.exitlist,@room.exitlist2)} {within|param=1}
#COND {%dh, %dm} {#priority {#forall @room.exitlist {#if (%ismember(%i,@room.lastexits)=0) {#additem room.newon %i}}};#priority {#forall @room.lastexits {#if (%ismember(%i,@room.exitlist)=0) {#additem room.newoff %i}}};#priority {#forall @room.newon {#noop %btnimage(cmp_%i,%i~_1~.bmp)}};#priority {#forall @room.newoff {#noop %btnimage(cmp_%i,%i~_0~.bmp)}};#if (%ismember(up,@room.newon) | %ismember(down,@room.newon) | %ismember(up,@room.newoff) | %ismember(down,@room.newoff)) {#noop %btnimage(cmp_ud,ud_%if(%ismember(up,@room.exitlist),1,0)%if(%ismember(down,@room.exitlist),1,0).bmp)};#if (%ismember(in,@room.newon) | %ismember(out,@room.newon) | %ismember(in,@room.newoff) | %ismember(out,@room.newoff)) {#noop %btnimage(cmp_io,io_%if(%ismember(in,@room.exitlist),1,0)%if(%ismember(out,@room.exitlist),1,0).bmp)};#var room.lastexits @room.exitlist;#var room.exitlist "";#var room.exitlist2 ""} {within|param=2|nocr|prompt}
#TRIGGER "cmp_1ex" {You see a single exit leading (*).$} {#var room.exitlist {%1};#var room.exitlist %replace({%replace({%replace({%replace({@room.exitlist}," ","")},"and","|")},",|","|")},",","|");#var room.exitlist %replace(@room.exitlist,"(opendoor)", "");#var room.exitlist %replace(@room.exitlist,"(closeddoor)", "");#var room.newon "";#var room.newoff ""}
#COND {%dh, %dm} {#priority {#forall @room.exitlist {#if (%ismember(%i,@room.lastexits)=0) {#additem room.newon %i}}};#priority {#forall @room.lastexits {#if (%ismember(%i,@room.exitlist)=0) {#additem room.newoff %i}}};#priority {#forall @room.newon {#noop %btnimage(cmp_%i,%i~_1~.bmp)}};#priority {#forall @room.newoff {#noop %btnimage(cmp_%i,%i~_0~.bmp)}};#if (%ismember(up,@room.newon) | %ismember(down,@room.newon) | %ismember(up,@room.newoff) | %ismember(down,@room.newoff)) {#noop %btnimage(cmp_ud,ud_%if(%ismember(up,@room.exitlist),1,0)%if(%ismember(down,@room.exitlist),1,0).bmp)};#if (%ismember(in,@room.newon) | %ismember(out,@room.newon) | %ismember(in,@room.newoff) | %ismember(out,@room.newoff)) {#noop %btnimage(cmp_io,io_%if(%ismember(in,@room.exitlist),1,0)%if(%ismember(out,@room.exitlist),1,0).bmp)};#var room.lastexits {@room.exitlist};#var room.exitlist ""} {within|param=1|nocr|prompt}
#CLASS 0
#ALIAS cmp {#if (%trigger(compass)) {#t- compass;#say COMPASS OFF} {#t+ compass;#say COMPASS ON}}


Verithrax2006-09-05 20:39:45
The graphics are available from myself, though. Just ask. Five credits. deal.gif
Everiine2006-09-05 20:44:58
I solve that by using Nexus, which already has the compass tongue.gif. But that's amazing that you programmed a new one!

I solve that by using Nexus, which already has the compass tongue.gif. But that's amazing that you programmed a new one!
Unknown2006-09-06 00:55:08
I wish zMUD could parse the ATCP messages, but I'm sure Zugg doesn't care to program a feature that'll only for for 4-5 games.

Maybe I'll get around to making a compass that updates off the mapper exits, based on what Laysus has shared here. Of course, I just use my mapper to know where I am and where I can go, so I don't really need buttons taking up more space, either. tongue.gif
Laysus2006-09-06 01:24:19
I had a gap to fill! tongue.gif

Formally the spacer with the fairy picture on it (stolen from NWN2 concept art) was twice as wide, I just figured it'd be cool in there. And help me run away better.
Unknown2006-09-06 01:49:43
I made a compass once, and I used the tiny icon images built into zMUD.

IPB Image

The middle button (N with a circle) does a QL. The up triangle is 'up' and the down triangle is, of course, 'down.' It doesn't update with disabled buttons, though.

CODE
#CLASS {Palisade|Compass}
#BUTTON 0 {}    {nw}    {} {} {} {} {DIRNW}     {Size} {45} {23} {} {} {} {15} {} {} {} "" {Explore}       {} {btn_nw}
#BUTTON 0 {}    {n}     {} {} {} {} {DIRN}      {Size} {50} {23} {} {} {} {15} {} {} {} "" {Explore|Stack} {} {btn_n}
#BUTTON 0 {}    {ne}    {} {} {} {} {DIRNE}     {Size} {45} {23} {} {} {} {15} {} {} {} "" {Explore|Stack} {} {btn_ne}
#BUTTON 0 {}    {w}     {} {} {} {} {DIRW}      {Size} {45} {23} {} {} {} {15} {} {} {} "" {Explore}       {} {btn_w}
#BUTTON 0 {}    {exits} {} {} {} {} {DIRECTION} {Size} {50} {23} {} {} {} {15} {} {} {} "" {Explore|Stack} {} {btn_exits}
#BUTTON 0 {}    {e}     {} {} {} {} {DIRE}      {Size} {45} {23} {} {} {} {15} {} {} {} "" {Explore|Stack} {} {btn_e}
#BUTTON 0 {}    {sw}    {} {} {} {} {DIRSW}     {Size} {45} {23} {} {} {} {15} {} {} {} "" {Explore}       {} {btn_sw}
#BUTTON 0 {}    {s}     {} {} {} {} {DIRS}      {Size} {50} {23} {} {} {} {15} {} {} {} "" {Explore|Stack} {} {btn_s}
#BUTTON 0 {}    {se}    {} {} {} {} {DIRSE}     {Size} {45} {23} {} {} {} {15} {} {} {} "" {Explore|Stack} {} {btn_se}
#BUTTON 0 {}    {u}     {} {} {} {} {ARROWU}    {Size} {70} {23} {} {} {} {15} {} {} {} "" {Explore}       {} {btn_up}
#BUTTON 0 {}    {d}     {} {} {} {} {ARROWD}    {Size} {70} {23} {} {} {} {15} {} {} {} "" {Explore|Stack} {} {btn_down}
#BUTTON 0 {in}  {in}    {} {} {} {} {}          {Size} {70} {23} {} {} {} {15} {} {} {} "" {Explore}       {} {btn_in}
#BUTTON 0 {out} {out}   {} {} {} {} {}          {Size} {70} {23} {} {} {} {15} {} {} {} "" {Explore|Stack} {} {btn_out}
#CLASS 0

#ECHO {}
#ECHO {** Palisade Compass, version 1.0}
Unknown2006-09-06 03:54:09
QUOTE(Zarquan @ Sep 5 2006, 02:55 PM) 328326

I wish zMUD could parse the ATCP messages, but I'm sure Zugg doesn't care to program a feature that'll only for for 4-5 games.

Maybe I'll get around to making a compass that updates off the mapper exits, based on what Laysus has shared here. Of course, I just use my mapper to know where I am and where I can go, so I don't really need buttons taking up more space, either. tongue.gif


As for parsing ATCP, Whyte's does that. I use a modified version of the mapper, but I'd like to bring the rest of the system in just for the subbed out prompt that updates even while blacked out.
Marius2006-09-06 05:47:43
Here's what I've been using. Nothing fancy. To catch the exits you'll need to CONFIG COLOUR EXITS 12 0. I think that's the default, though.

Here's what it looks like (bottom left).

CODE
#CLASS {Compass}
#ALIAS ShowExits {#CALL %btnenable(btnnw,%ismember(northwest,%1));#CALL %btnenable(btnn,%ismember(north,%1));#CALL %btnenable(btnne,%ismember(northeast,%1));#CALL %btnenable(btnw,%ismember(west,%1));#CALL %btnenable(btne,%ismember(east,%1));#CALL %btnenable(btnsw,%ismember(southwest,%1));#CALL %btnenable(btns,%ismember(south,%1));#CALL %btnenable(btnse,%ismember(southeast,%1));#CALL %btnenable(btnd,%ismember(down,%1));#CALL %btnenable(btnu,%ismember(up,%1));#CALL %btnenable(btnout,%ismember(out,%1));#CALL %btnenable(btnin,%ismember(in,%1))}
#REGEX {^\\e\\
Daganev2006-09-06 05:52:04
QUOTE(Zarquan @ Sep 5 2006, 05:55 PM) 328326

I wish zMUD could parse the ATCP messages, but I'm sure Zugg doesn't care to program a feature that'll only for for 4-5 games.

Maybe I'll get around to making a compass that updates off the mapper exits, based on what Laysus has shared here. Of course, I just use my mapper to know where I am and where I can go, so I don't really need buttons taking up more space, either. tongue.gif


Mention that in the CMUD wish list. he just might get to it.
Unknown2006-09-06 11:27:12
QUOTE(Marius @ Sep 6 2006, 01:47 AM) 328426

Here's what I've been using. Nothing fancy. To catch the exits you'll need to CONFIG COLOUR EXITS 12 0. I think that's the default, though.

Here's what it looks like (bottom left).


ACP, eh? I wonder what the 'A' stands for... wink.gif


Dag, I really doubt he would. In fact, I may have already mentioned it once and he turned it down. He prefers to support the open standards that anyone could use in their MUD, which I completely understand.
Unknown2006-09-06 11:56:58
What would be nice from Zugg would be a way to arbitrarily handle telnet options, so that you could define an option and just right your own way of handling it. SO in ATCPs case just configure the settings to allow option 200, and then tell it to call a specific bit of code and zMUD just passes any sub negotitaions of that option unedited straight to the code.
Tiran2006-09-06 15:39:27
Is there somewhere listing the ATCP messages, or would one have to dig through Whyte's code/use trial and error to get them? I'd love to be able to graft them into tf for use there. One advantage of open source software I guess.
Unknown2006-09-06 16:42:42
QUOTE(Tiran @ Sep 6 2006, 11:39 AM) 328536

Is there somewhere listing the ATCP messages, or would one have to dig through Whyte's code/use trial and error to get them? I'd love to be able to graft them into tf for use there. One advantage of open source software I guess.


http://www.ironrealms.com/rapture/manual/f...atATCP-txt.html
Tiran2006-09-06 16:53:40
Sorry, I wasn't too clear there. I meant the actual message texts for sending stats/locations/exits/etc... used by Lusternia. That only covers the telnet option negotiation from the looks of it.
Unknown2006-09-07 02:07:22
The telnet codes ARE the messages sent for stats, locations, exits, etc. Most clients will ignore the codes because they're outside the normal range, but specialized clients like Nexus capture them for updating the gauges, compass, etc.
Unknown2006-09-20 21:34:14
I'm trying these compasses out but each one is busted in it's own way...

Laysus's doesn't even work.
Zarquan's Buttons are all out of whack. (Not in Order, North is where west should be, South is at east etc.)
And Marius's doesn't have buttons.

Anyhelp please?
Laysus2006-09-20 21:45:15
Mine needs the buttons arranged right in the right places and also -for the graphics to be in the right folder (the rood Zmud folder).
Unknown2006-09-20 21:46:12
QUOTE(Laysus @ Sep 20 2006, 05:45 PM) 333778

Mine needs the buttons arranged right in the right places and also -for the graphics to be in the right folder (the rood Zmud folder).


yours doesn't even pop up when I copy and paste the box o' craziness.
Unknown2006-09-20 22:11:17
Mine doesn't use external images for the buttons, but you have to move the compass buttons to either the right or left side of your window to get the proper layout. Just select one of the buttons in your settings, go to the Position/Size tab and pick a side. It's a stupid way to do things, but buttons were an afterthought in zMUD.
Unknown2006-11-08 04:33:57
I was wondering how do i use your compass laysus? i wanted to know where i copy and past it to or where do i place it in mush client to make it work? message me back please