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 Goto page 1, 2  Next
Minstrel
Beginner


Joined: 07 Dec 2001
Posts: 21

PostPosted: Fri Dec 07, 2001 2:21 am   

Making a compass
 
How would one go about making a compass for a MUD, if its possible. I know how to make basic triggers and such, and noticed a graphical health bar can be made(Not to clear on how to, though not important) and would like to know how would a compass be made.

Basic Room description:

Precarious bluff above the ocean.
You see exits leading north, south and west.
Reply with quote
decantor
Apprentice


Joined: 14 Nov 2001
Posts: 100

PostPosted: Fri Dec 07, 2001 4:22 am   
 
I'm not entirely sure what you mean. A compass basically tells you which direction you are facing, which is not really applicable to mudding...
Reply with quote
Minstrel
Beginner


Joined: 07 Dec 2001
Posts: 21

PostPosted: Fri Dec 07, 2001 7:34 am   
 
quote:

I'm not entirely sure what you mean. A compass basically tells you which direction you are facing, which is not really applicable to mudding...





I meant a graphical compass as to which directions one may head to in that room.
Reply with quote
undergod
Wanderer


Joined: 27 Jun 2001
Posts: 82

PostPosted: Fri Dec 07, 2001 8:24 am   
 
I think he means like, lil arrows pointing in the four directions that will light up if he can move that direction. Or something along those lines.
Reply with quote
Castaway
GURU


Joined: 10 Oct 2000
Posts: 793
Location: Swindon, England

PostPosted: Fri Dec 07, 2001 8:51 am   
 
You mean a graphical compass, like in the RPG games, where you can click on a directionto go?

Theres no way to make any new graphical items in zMUD, you'd have to programm that using a plugin. The nearest you can get with what there is, is to use a pickbox, which is a list of text items to click on, or a speed-menu, which you can choose from using the right mouse button. You could set up each of these to only contain the directions that are available.
If you want more help on that, just ask.

Lady C.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sat Dec 08, 2001 12:33 am   
 
quote:

You mean a graphical compass, like in the RPG games, where you can click on a directionto go?

Theres no way to make any new graphical items in zMUD, you'd have to programm that using a plugin. The nearest you can get with what there is, is to use a pickbox, which is a list of text items to click on, or a speed-menu, which you can choose from using the right mouse button. You could set up each of these to only contain the directions that are available.
If you want more help on that, just ask.

Lady C.



Actually, there IS an easy way to make a native graphical compass. The interface consists of 8 buttons which correspond to each direction. If you really wanted to get fancy, you could add a ninth button do handle portal exits or do some other action like LOOK. This part of the compass is pretty much tied up in how your mud displays portal exits, so I won't explain how to go about doing it.

The supporting settings would be similar to this:

1 trigger to capture exits (calls the alias)
1 alias to process captured exits (created to encapsulate the compass)

An overly simplistic model, but that's all there is to it.

The alias would do just one loop to hit all directions. If a given direction is found in the Exits, the corresponding button image is changed to the corresponding red directional arrow. If said direction is not found in Exits, a BOX or some other picture is used to denote "no direction".

li'l shmoe of Dragon's Gate MUD
Reply with quote
Troubadour
GURU


Joined: 14 Oct 2000
Posts: 556
Location: USA

PostPosted: Sat Dec 08, 2001 8:24 am   
 
OK, so far I have a graphical compass you can look at. I working on an interactive compass using MXP, I can't quite get it to parse the < and >. First, create a new window, #WIN compass and manually resize it to about 3/4 inch square. Then enter this trigger:


#TR {^You see exits leading (*).} {
#VAR validDirs %replace(%replace(%replace("%1", ",", ""), "and ", ""), " ", "|")
#VAR topRow ""
#VAR topRow %concat(@topRow, %if(%ismember("northwest", @validDirs), "NW ", " "))
#VAR topRow %concat(@topRow, %if(%ismember("north", @validDirs), "N", " "))
#VAR topRow %concat(@topRow, %if(%ismember("northeast", @validDirs), " NE", ""))
#VAR midRow ""
#VAR midRow %concat(@midRow, %if(%ismember("west", @validDirs), " W", " "))
#VAR midRow %concat(@midRow, "-+-")
#VAR midRow %concat(@midRow, %if(%ismember("east", @validDirs), "E", ""))
#VAR botRow ""
#VAR botRow %concat(@botRow, %if(%ismember("southwest", @validDirs), "SW ", " "))
#VAR botRow %concat(@botRow, %if(%ismember("south", @validDirs), "S", " "))
#VAR botRow %concat(@botRow, %if(%ismember("southeast", @validDirs), " SE", ""))
:compass:#CLR
:compass:#SAY @topRow
:compass:#SAY " |/"
:compass:#SAY @midRow
:compass:#SAY " /|"
:compass:#SAY @botRow
}


Troubadour
Reply with quote
Troubadour
GURU


Joined: 14 Oct 2000
Posts: 556
Location: USA

PostPosted: Sat Dec 08, 2001 9:35 am   
 
OK, I have the interactive compass. For some reason the %concat function was eating the < and >, so I rewrote it a bit. As before create a new window named compass,#WIN compass, and resize it to about 3/4 inch square. The compass sends the commands to a window named SampleMUD; you should change it to whatever your main MUD window is called.


#TRIGGER {^You see exits leading (*).} {
#VAR validDirs %replace( %replace( %replace( "%1", ",", ""), "and ", ""), " ", "|")
#VAR NWpt %if( %ismember( "northwest", @validDirs), "<send ':SampleMUD:nw'>NW</send>", " ")
#VAR Npt %if( %ismember( "north", @validDirs), "<send ':SampleMUD:n'>N</send>", " ")
#VAR NEpt %if( %ismember( "northeast", @validDirs), "<send ':SampleMUD:ne'>NE</send>", "")
#VAR Wpt %if( %ismember( "west", @validDirs), "<send ':SampleMUD:w'>W</send>", " ")
#VAR Ept %if( %ismember( "east", @validDirs), "<send ':SampleMUD:e'>E</send~>", "")
#VAR SWpt %if( %ismember( "southwest", @validDirs), "<send ':SampleMUD:sw'>SW</send>", " ")
#VAR Spt %if( %ismember( "south", @validDirs), "<send ':SampleMUD:s'>S</send>", " ")
#VAR SEpt %if( %ismember( "southeast", @validDirs), "<send ':SampleMUD:se'>SE</send>", "")
:compass:#CLR
:compass:#MXP @NWpt @Npt @NEpt
:compass:#SAY " |/"
:compass:#MXP %char( 32)@Wpt-+-@Ept
:compass:#SAY " /|"
:compass:#MXP @SWpt @Spt @SEpt
}


Happy Mudding!

Troubadour
Reply with quote
Castaway
GURU


Joined: 10 Oct 2000
Posts: 793
Location: Swindon, England

PostPosted: Sat Dec 08, 2001 11:14 am   
 
*looks amazed* :)

Lady C.
Reply with quote
Minstrel
Beginner


Joined: 07 Dec 2001
Posts: 21

PostPosted: Sat Dec 08, 2001 7:50 pm   
 
The compass is working out great, but it won't dectect exits in certain rooms, for instance...

You see exits leading west and up.
You see a single exit leading east.
You see exits leading west (door) and up.

How do I change it so that it will dectect those type of exits?
Reply with quote
Tarn
GURU


Joined: 10 Oct 2000
Posts: 873
Location: USA

PostPosted: Sun Dec 09, 2001 5:47 am   
 
quote:

You see exits leading west and up.
You see a single exit leading east.
You see exits leading west (door) and up.



I assume that you have two problems:
1. It won't detect 'up' or 'down'
2. It won't work for "You see a single..."

About the first problem:
See how there's a line in the trigger for detecting whether there's an exit for each direction?



#VAR NWpt %if( %ismember( "northwest", @validDirs), "<send ':SampleMUD:nw'>NW</send>", " ")

and corresponding lines for displaying each 'line' of the compass rose?


:compass:#MXP @NWpt @Npt @NEpt
:compass:#SAY " |/"


Decide how you want the up and down exits to look, and then insert lines in each place. If noone else has time this weekend and you're still having trouble, I'll help you out, but it will have to wait until Monday or so since I want to check my code and I'm not by my zMud box (*sob*) :P.

About the second problem:

You might want to stick all of Troubdor's code into a single alias, which is triggered by either:
{^You see exits leading (*).}
or
{^You see a single exit leading (*).}

This way you'd only have the code to create the compass rose in one place, which makes it easier to enhance/maintain. (The quicker to type alternative is to cut and paste the contents of the trigger into a new trigger actuated by the 'single exit' line)

-Tarn


edit: deleted an incorrect reference to the V1 script.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Dec 09, 2001 9:45 am   
 
hmm, it's not working for me. All I'm getting is this in normal text:

@NWpt @Npt @NEpt
|/
%char( 32)@Wpt-+-@Ept
/|@SWpt @Spt @SEpt


My exits are set up a tad differently:

Obvious exits: exit1 exit2 exitn.
Obvious paths: exit1 exit2 exitn.

Any exit can have an * appended to it (ie, exit2*) which denotes a lit room, but other than that it's not that important to determine the existence unless it'd interfere with MXP or something.

Here's what I've gotten after modifying Troubadour's version (#2).

#TRIGGER {^Obvious %w: (*)~.} {#VAR validDirs %replace( %replace( %1, "*", ""), " ", "|");#VAR NWpt %if( %ismember( "northwest", @validDirs), "<send ':MattLofton:nw'>NW</send>", " ");#VAR Npt %if( %ismember( "north", @validDirs), "<send ':MattLofton:n'>N</send>", " ");#VAR NEpt %if( %ismember( "northeast", @validDirs), "<send ':MattLofton:ne'>NE</send>", "");#VAR Wpt %if( %ismember( "west", @validDirs), "<send ':MattLofton:w'>W</send>", " ");#VAR Ept %if( %ismember( "east", @validDirs), "<send ':MattLofton:e'>E</send~>", "");#VAR SWpt %if( %ismember( "southwest", @validDirs), "<send ':MattLofton:sw'>SW</send>", " ");#VAR Spt %if( %ismember( "south", @validDirs), "<send ':MattLofton:s'>S</send>", " ");#VAR SEpt %if( %ismember( "southeast", @validDirs), "<send ':MattLofton:se'>SE</send>", "");:compass:#CLR;:compass:#MXP @NWpt @Npt @NEpt;:compass:#SAY " |/";:compass:#MXP %char( 32)@Wpt-+-@Ept;:compass:#SAY " /|";:compass:#MXP @SWpt @Spt @SEpt}

Any ideas what I'm doing wrong here?

li'l shmoe of Dragon's Gate MUD
Reply with quote
Troubadour
GURU


Joined: 14 Oct 2000
Posts: 556
Location: USA

PostPosted: Sun Dec 09, 2001 10:53 pm   
 
quote:

hmm, it's not working for me. All I'm getting is this in normal text:


Any ideas what I'm doing wrong here?

li'l shmoe of Dragon's Gate MUD



Make sure that you have MXP enabled in View:Preferences.

Troubadour
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon Dec 10, 2001 2:20 am   
 
quote:

quote:

hmm, it's not working for me. All I'm getting is this in normal text:


Any ideas what I'm doing wrong here?

li'l shmoe of Dragon's Gate MUD



Make sure that you have MXP enabled in View:Preferences.

Troubadour



Hmm, would this entail anything more than making sure the Enable MXP protocol checkbox is checked? It's already checked, by the way.

EDIT: I just went and played with #MXP for a little bit and literal MXP commands (ie, #MXP <send href='north'>North</send>) work fine. It's something with the @ that #MXP doesn't seem to like...#MXP isn't dependant on MUD settings if I use secure commands on my side, right?
li'l shmoe of Dragon's Gate MUD
Reply with quote
sponge-bob
Beginner


Joined: 10 Nov 2001
Posts: 18

PostPosted: Mon Dec 10, 2001 6:17 am   
 
Is there a way to make it so it dont underline the text?
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon Dec 10, 2001 6:36 am   
 
quote:

Is there a way to make it so it dont underline the text?



Yep, go into MXP preferences and uncheck the box next to Underline MXP links (or something similar)

li'l shmoe of Dragon's Gate MUD
Reply with quote
Minstrel
Beginner


Joined: 07 Dec 2001
Posts: 21

PostPosted: Mon Dec 10, 2001 9:34 pm   
 
Erm...alright still lost. I'm using the first of his triggers, I can't seem to get the second to work and the first seems just fine. I honestly didn't have a clue to what was supposed to be changed sorry.

For the second trigger though...all I get is...
@NWpt @Npt @NEpt
|/
%char( 32)@Wpt-+-@Ept
/|@SWpt @Spt @SEpt

I do have MXP enabled also
Reply with quote
Thandril
Adept


Joined: 03 Dec 2000
Posts: 260

PostPosted: Sun Dec 16, 2001 12:09 pm   
 
Matt,

I don't know why you don't use my Plugin for DGate that puts up the graphical compass. :P

Anyhow, I have a graphical compass I wrote for DGate that parses exits and captures hit points, fatigue, etc to a floating window. It would be possible to modify to work with other MU*s I'm sure. Only barrier is time and money!
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Dec 16, 2001 7:19 pm   
 
quote:

Matt,

I don't know why you don't use my Plugin for DGate that puts up the graphical compass. :P

Anyhow, I have a graphical compass I wrote for DGate that parses exits and captures hit points, fatigue, etc to a floating window. It would be possible to modify to work with other MU*s I'm sure. Only barrier is time and money!



Heh, by the time you had it all ready to go, I had most of it already done in Zscript.

I did check it out, however, but I didn't think it necessary I use it

li'l shmoe of Dragon's Gate MUD
Reply with quote
Minstrel
Beginner


Joined: 07 Dec 2001
Posts: 21

PostPosted: Sat Dec 22, 2001 2:36 am   
 
I've gotten everything else to work except for exits with doors.

You see exits leading north (open door), northeast (open door), southeast (open
door), south (open door) and west.

I'm not sure just how to fix the compass to decect these exits.
Reply with quote
Troubadour
GURU


Joined: 14 Oct 2000
Posts: 556
Location: USA

PostPosted: Sat Dec 22, 2001 5:41 am   
 
Revise the validDirs parser with:

#VAR validDirs %replace(%replace(%replace(%replace("%1", " (open door)", ""), ",", ""), "and ", ""), " ", "|")



Troubadour

P.S. Matt, I've tried playing with various settings, but I can't get the pesky trigger to not work, sorry.
Reply with quote
Minstrel
Beginner


Joined: 07 Dec 2001
Posts: 21

PostPosted: Sun Dec 23, 2001 9:03 pm   
 
quote:

Revise the validDirs parser with:

#VAR validDirs %replace(%replace(%replace(%replace("%1", " (open door)", ""), ",", ""), "and ", ""), " ", "|")



Troubadour



Some reason that doesn't work. It does when there is only 1 (open door) exit in the room, but when there are multiple ones it won't register.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon Dec 24, 2001 6:56 am   
 
quote:

P.S. Matt, I've tried playing with various settings, but I can't get the pesky trigger to not work, sorry.



No prob. I figure it's some archaic line of code Zugg forgot about or something and has since been corrupted by the now blessedly-few fatal errors and freezes I get while working the scripter in new, bizarre ways:).

li'l shmoe of Dragon's Gate MUD
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Dec 30, 2001 11:35 pm   
 
quote:

Revise the validDirs parser with:

#VAR validDirs %replace(%replace(%replace(%replace("%1", " (open door)", ""), ",", ""), "and ", ""), " ", "|")



Troubadour

P.S. Matt, I've tried playing with various settings, but I can't get the pesky trigger to not work, sorry.



Are you using a beta version perchance? According to the help files for version 6.16, it seems #MXP only works with literals and doesn't expand variables. Ideas?

li'l shmoe of Dragon's Gate MUD
Reply with quote
Minstrel
Beginner


Joined: 07 Dec 2001
Posts: 21

PostPosted: Thu Jan 10, 2002 1:33 am   
 
I still havn't been able to get the compass to work with multiple door exits, if someone can help me out with that.

It works where there is only a single exit that has a doorway, but when theres several of them it doesn't register oddly.

You see exits leading north (open door), northeast (open door), southeast (open
door), south (open door) and west.

It won't pick up exits leading up and down with doorways either, but I got it to get exits leading up and down without doorways.

You see exits leading down (open door)
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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