|
Berrai Beginner
Joined: 10 Jul 2010 Posts: 11 Location: Globe Trotter
|
Posted: Mon Feb 28, 2011 10:45 am
Automapper and Swimming(CMUD Pro 3.33a) |
Ok, so let me start by saying I love CMUD, you guys are awesome! Unfortunately, I suck at scripting.
What I would like to do is use the room type property to trigger the correct commands when swimming prior to sending the command, so as to not create problems with the speed walk function. Is there a way to trigger off that property? |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Mon Feb 28, 2011 3:26 pm |
There are numerous ways you could do it.
1) You could give all of the appropriate exits in your water rooms the appropriate swim command.
2) You could create a new type of exits specifically for swimming exits.
3) You could create command triggers for the movement commands that check the room type.
If you give us more information, we may be able to give more specific assistance. |
|
|
|
Berrai Beginner
Joined: 10 Jul 2010 Posts: 11 Location: Globe Trotter
|
Posted: Mon Feb 28, 2011 3:56 pm |
Ok, so what I know and what I don't..
This is for Lusternia, which supports both MXP and GMCP. The MXP coming in doesn't give any information on the type of terrain, but the GMCP does. (Didn't find this out until after my last post) What I have been doing so far is creating the rooms manually, and manually editing the exits to use the proper swim "dir" command as you noted in #1. However, this has a couple of problems. First it is terribly tedious and inefficient. Secondly, the mud outputs "You begin to steadily swim (dir)" comment that triggers the auto-mapper and screws up all the exits. Secondly, when I use the "swim (dir)" command from the command line, it doesn't generate a room at all, even once it receives the MXP lines.
I have no clue how to do #2 on your list, but it seems like it would suffer from the same inefficiency problem as I would need to edit each and every exit.
#3 would be great, but I have no idea how to do it. Even better would be to have the Automapper update the room type off the GMCP environment variable and then have a trigger that checks the upcoming room for the type and sends the appropriate command. Again though, I am severely limited by my non-existent scripting skills.
Example MXP output:
<RNum 5665><RName>Moon River.</RName>
Superimposed over this location, an ethereal forest reaches up to the sky. The
stars twinkle in the clear night sky. <RDesc>The water here runs cold and strong, its
current pulling swiftly in the centre of the wide waters. Fragments of branch
and twig bob along the surface, plunging southeast along the water's surface to
vanish amongst the trees. Here and there a particularly large branch sticks out
of the river, steadfast against the almost overwhelming flow.</RDesc> A red-striped
salamander slides through the shallow waters.
<EXPIRE "exits"><RExits>You see exits leading <COLOR #FFFF00><SEND HREF="north" EXPIRE="exits">north</SEND></COLOR>, <COLOR #FFFF00><SEND HREF="southeast" EXPIRE="exits">southeast</SEND></COLOR>, and <COLOR #FFFF00><SEND HREF="northwest" EXPIRE="exits">northwest</SEND></COLOR>.</RExits>
Example GMCP output:
num=5665|name=Moon River|area=the Serenwilde Forest|environment=river|coords=188,-5,2,0|map="<A 'www.lusternia.com/irex/maps/clientmap.php?map=188&building=0&level=0'>www.lusternia.com/irex/maps/clientmap.php?map=188&building=0&level=0</A> 17 8"|details|exits="n=5649|se=5664|nw=841"
Thanks in advance, I know you guys get a lot of 'newb' questions from people. I appreciate you taking the time to answer. |
|
|
|
orphean Apprentice
Joined: 21 Oct 2008 Posts: 147 Location: Olympia, WA
|
Posted: Mon Feb 28, 2011 4:26 pm |
A low effort way to map this would be to use the MapDir character from the command line. It's > by default and you use it like this:
Code: |
>command to use>direction where the room should go |
So >swim e>e would make a room to the east with the 'swim e' command ready to go, In the new room you would then have to type >swim w>w to get the rooms to connect so there is an extra step involved.
This also works really well for all those 'in' and 'out' directions IronRealms games have. |
|
|
|
Berrai Beginner
Joined: 10 Jul 2010 Posts: 11 Location: Globe Trotter
|
Posted: Mon Feb 28, 2011 4:43 pm |
Yeah, just tried that orphean, it doesn't work out so well. It keeps popping open new rooms on the mapper when it shouldn't. I *think* and I could be wrong, that CMUD tries to treat any movement command other than a cardinal direction as a portal/in/out/other direction. If I do it using the >swim s>s it is going to create even more work because I will have to fix what it goofs up.
|
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Mon Feb 28, 2011 5:24 pm |
What do you mean "it goofs up"? What new rooms is it creating when it shouldn't? You need to give more information, as specific as you can.
As for my earlier suggestions for 1, 2, and 3, there may be ways of making the process automatic, which is why I asked you for more information. For instance, is there any way of automatically telling (from the description, name, or mxp codes) that the room is a water room, or that specific exits require the "swim" command? If there is, we can probably come up with triggers that will automatically make those changes to the exits. Unfortunately, I do not see anything in that text segment you pasted that would work for this kind of automatic identification. Can you think of any way of automatically telling that you need to use the "swim" command?
As for "You begin to swim steadily" causing problems, the trick is to make a trigger for that phrase, which executes the command #NOMAP. That command will cause the mapper to ignore the line.
The problem of "swim e" not creating a new room can be solved by all three of my solutions. |
|
|
|
Berrai Beginner
Joined: 10 Jul 2010 Posts: 11 Location: Globe Trotter
|
Posted: Mon Feb 28, 2011 5:38 pm |
Ok.. normally when you walk from one room to another in a cardinal direction, one of the 11 standard ones used, it creates a link in the desired direction, and then draws a room in that direction on the Automapper. When you use, the 'Other' direction, it creates a room that is disconnected on the map, using the little circle icon to represent the link. When I tried using the >swim e>e command that Orphean posted, it generated a room, but it created the rooms off in a random direction with the little circle icon to indicate a 'other' link instead of a cardinal direction link.
In the example GMCP code, I was thinking it could be triggered off of the '|environmental=river|' flag. As I said, there is nothing in the MXP that would useful triggering a swim only exit.(To the best of my knowledge) As I mentioned in my previously response to the methods you listed, #1 is what I am currently doing, #2 & #3 I don't know how to do. Out of them all #3 triggering off of the GMCP seems like the best long term fix. I can get the GMCP output, I just don't know how to use it to manipulate the Automapper. |
|
|
|
Berrai Beginner
Joined: 10 Jul 2010 Posts: 11 Location: Globe Trotter
|
Posted: Mon Feb 28, 2011 6:44 pm |
Actually, I just checked and using #Show %gmcp.room.info.environment will output a line that contains the room type only. i.e. constructed underground, river, freshwater, etc. Is there a way to set the Room Type to that and then if the room type is River, Freshwater etc to use the swim command?
One thing I forgot until a moment ago is that there is also prompt when you try to move into a water room without using the swim command.
"There's water ahead of you. You'll have to swim in that direction to make it
through."
I tried ..
#Trigger {There's water ahead of you.} {#NOMAP;swim %lastdir;#Gag 3}
..But it was like it wasn't parsing the %lastdir because I could see it echo the swim command, but not the direction. |
|
|
|
Berrai Beginner
Joined: 10 Jul 2010 Posts: 11 Location: Globe Trotter
|
Posted: Tue Mar 01, 2011 4:31 pm |
I sort of have some of it worked out now, and looking at my above post want to facepalm myself for not seeing why that didn't work.
#Trigger {There is water ahead of you} {#GAG;#SEND swim %lastdir}
That works, but introduces a problem for me. The Automapper receives the original direction, say East, for example, and puts it in the queue. When the triggering text is returned, the trigger fires, grabbing the East and sending 'swim east' to the MUD, just as it should. However, this leaves 'swim east' in the queue, so if the next direction used also fires the trigger, the it sends 'swim swim east' to the MUD.
I tried:
#Trigger {There is water ahead of you} {#NODIR;#GAG;#SEND swim %lastdir}
But it cleared the queue to early, and the #send swim was only returning 'swim'.
I also tried:
#Trigger {There is water ahead of you} {#GAG;#SEND swim %lastdir;#NODIR}
But that causes the mapper NOT to map the room.
Is there a way to clear the automapper buffer AFTER the room has been mapped/updated?
Also, if any of you are using GMCP triggers at the moment, could you please post an example or a screen shot? I can't seem to get it sorted out in the package editor. Specifically what I am trying to do is look at %gmcp.room.info:environmental and pull the value from that into a variable named @environmental so that I can use it to update the Room Type in each room for future use. |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Tue Mar 01, 2011 10:44 pm |
here's an example of a GMCP room trigger:
#event onRoomEnter {
#if (%maplocked() = 0) {
#call %roomflags(,"Room Type: "%gmcp.room.info.terrain)
}
}
Now, obviously that's a bit of a joke because I didn't provide an example of an actual trigger. But you don't really need one for most things you want to do with the room package, thanks to the internal raising of the onRoomEnter event by CMud.
To actually use a GMPC trigger, you can only match on the package.key value (ie, room.info rather than room.info.environmental). |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Berrai Beginner
Joined: 10 Jul 2010 Posts: 11 Location: Globe Trotter
|
Posted: Sun Mar 06, 2011 7:37 pm |
Just thought I would check back and see if anyone could point me in the direction of how to clear the mapper queue (see post above for details).
Cheers guys, and thanks for all the help |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4701 Location: Pensacola, FL, USA
|
Posted: Sun Mar 06, 2011 10:51 pm |
#NODIR 0 i think should clear it.. you can also use the set position toggle or change the value of %maplocked
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
|
|
|
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
|
|