 |
Scarn Apprentice
Joined: 24 Jul 2005 Posts: 137
|
Posted: Thu Jun 14, 2012 8:48 pm
Map Issues (SAFE speedwalk and room script triggers) |
Hello,
I recently had my laptop stolen and lost my zMUD map, I've taken this opportunity to start from scratch on cMUD.
I'm having two major problems:
1. SAFE mode isn't working, I have run debug mode and found the issue - just cannot fix it. Basically when I speedwalk in SAFE mode it runs the path but #OK is only fired in the last room, therefore on the MUD I will travel the full distance but the map will only move one room (as the #OK trigger only fires once), I can't find anything in the settings to fix this.
2. I use a lot of room script triggers (triggers that I only want to fire if I am in a certain room), however when I pass through the room these triggers are being saved as standard triggers and firing wherever I am (never had this issue on zMUD so I'm hoping there is some new command I don't know).
Any help would be great,
Cheers |
|
|
 |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Fri Jun 15, 2012 12:28 am |
1)The mapper uses the prompt to verify room movement, and once it finds the prompt it can go backwards through the scrollback buffer to parse out room name, description, exits, and so forth. If the mapper is set up to not use a prompt, then the mapper simply takes a guess and accuracy becomes a crapshoot.
With this in mind, two things are likely occurring. First, when you ran the autoconfiguration wizard the mapper did in fact correctly detect the room name, description, exits, and prompt and you are able to walk around room-by-room with no problems. Second, during a speedwalk, your game only sends you the prompt line at the end of the walk rather than after each move is made. If this is your problem, then you will need to trigger on some other line other than your actual prompt and #TAG that line as your prompt (given that it's not sending you the prompt between rooms, this is likely going to be a blank line and it's probably going to be easier to just #TAG everything else as well). |
|
_________________ EDIT: I didn't like my old signature |
|
|
 |
Scarn Apprentice
Joined: 24 Jul 2005 Posts: 137
|
Posted: Fri Jun 15, 2012 3:07 pm |
My prompt is sent after every room, also in DEBUG mode no triggers fire on my prompt. I slowed down my speedwalking and now it follows to certain degree, although it is very buggy if any lag occurs so not a real fix.
|
|
|
 |
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Fri Jun 15, 2012 5:39 pm |
Room scripts are completely different from the way Zmud did them. Room scripts are now ordinary triggers, aliases, variables, etc. which are stored in a class which is automatically enabled and disabled when you enter or leave the room. Is this the way you have it set up? Can you send us the XML for one of these room scripts? Use the following procedure:
In the package editor, click to select the class containing the script(s).
At the bottom of the editor window, click the XML tag
Select the entire text in the editor window, and type CTRL-C to copy it into the buffer.
Here in the forums, start a reply to the thread.
Type CTRL-V to paste the buffer into the window.
Just before the pasted text, type the following: [code]
Just after the pasted text, type the following: [/code] |
|
|
 |
Scarn Apprentice
Joined: 24 Jul 2005 Posts: 137
|
Posted: Fri Jun 15, 2012 9:14 pm |
Here is an example of one room trigger.
Code: |
<class name="Room490" keyword="Room490" enabled="false" id="56">
<onenable>#VAR Does {press button}
#TRIGGER {its pedestal away} {play}
#TRIGGER {You have completed a quest: MT1: Old Wizard's Game} {#tel 416}
#TRIGGER {A strange force seems to push you back as you try to} {#TELEPORT 487}</onenable>
</class>
|
|
|
|
 |
Scarn Apprentice
Joined: 24 Jul 2005 Posts: 137
|
Posted: Fri Jun 15, 2012 9:17 pm |
This trigger fires no matter what room I am in. I've tried deleting it from the trigger settings as well but as soon as I move through the room it recreates it.
The way I make room script triggers:
Select room properties > Select edit room scripts > Type trigger/alias/variable in the box and click save. |
|
|
 |
Scarn Apprentice
Joined: 24 Jul 2005 Posts: 137
|
Posted: Fri Jun 15, 2012 11:30 pm |
UPDATE:
I made the following trigger to prompt the client to fire #OK in the rooms, but now CMUD is running the #OK trigger itself as WELL as the custom trigger, when I disable my trigger it doesnt work again.
Obviously double firing is not a fix as the map puts me in the room I'm travelling too long before I reach it on the MUD.
This was the trigger I made.
Code: |
<trigger priority="1360" enabled="true" id="136">
<pattern>%w~(*~)</pattern>
<value>#OK</value>
</trigger>
|
|
|
|
 |
Scarn Apprentice
Joined: 24 Jul 2005 Posts: 137
|
Posted: Fri Jun 15, 2012 11:36 pm |
I've fixed it, in case anyone else is having the same problem here is what I did.
I made a trigger to manually fire the #OK command in each room, for my client room names are set out like this:
A Street (n, s and e)
So I made a trigger to capture if I am in a room and then fire the #OK command like so:
Code: |
<trigger priority="1360" enabled="true" id="136">
<pattern>%w~(*~)</pattern>
<value>#OK</value>
</trigger>
|
Then in the map configuration settings in the speedwalking tab I checked "Disable automatic step confirmation". SAFE mode now works perfectly. |
|
|
 |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Fri Jun 15, 2012 11:44 pm |
Here's how to make room scripts that use triggers/aliases/etc the right way (in the example we'll create a trigger to match on the phrase "this is a test" and prints "hello" to the screen):
1)get the current room's roomkey value (we'll assume #123)
2)open up the Package Editor
3)click on the Mapper object to highlight it
4)click on the New button and create a new class
5)set the following fields:
--)name = whatever you wish (we'll call it Test1)
--)Key = Room123
6)using the New button, create a new trigger
7)set the following fields
--)pattern = this is a test
--)code = #print "hello" |
|
_________________ EDIT: I didn't like my old signature |
|
|
 |
Scarn Apprentice
Joined: 24 Jul 2005 Posts: 137
|
Posted: Sat Jun 16, 2012 2:35 am |
Is this different to automatically creating them from the map properties menu? All the ones I've made via the map have created own classes.
|
|
|
 |
Daern Sorcerer
Joined: 15 Apr 2011 Posts: 809
|
Posted: Sat Jun 16, 2012 3:54 am |
As Rahab said before, these classes are enabled every time you enter that room. You've typed your code into the enable script of the class, so it's running every time you enter the room (when the class gets enabled) and creates new triggers every time, which is what the #trigger command does. What you want is to actually create permanent triggers within that class, like you would create any other trigger. You could use Matt's procedure of manually creating the class, or have the mapper create it for you by clicking the edit scripts button in the map properties window. How the class is created doesn't really matter, what's important is how you create the triggers.
|
|
|
 |
Scarn Apprentice
Joined: 24 Jul 2005 Posts: 137
|
Posted: Sat Jun 16, 2012 1:22 pm |
Ah, I get it now. Works perfectly, thanks!
|
|
|
 |
|
|