|
Toshiro Beginner
Joined: 01 Nov 2006 Posts: 14
|
Posted: Thu Dec 27, 2007 12:21 am
[2.18] Map follow script problems (and map dissapeared) |
I upgraded to 2.18 recently and I have a problem with a script that I have been running for a long while. I don't get the command line syntax, so here it is from the boxes.
Code: |
Class :Fleescript
@A Flee
Trigger: Flee Trig
Pattern ^You flee head over heels.$
1. Flee=""
Pattern ^(*)$FleeRoom$$FleeRoom=%replace(%1, "'", "''")$#FORALL %roomexit() {#ADDITEM Flee.connect %roomlink( ,%i)}$#ForALL @Flee.connect {#IF (%ismember( %i,(%mapquery({[Name] LIKE '%$FleeRoom%'})))) {#ADDITEM Flee.Found %i}}$#switch (%numitems(@Flee.Found)=1) {#SAY Room found Teleporting.;#TELEPORT @Flee.Found} (%numitems(@Flee.Found)>1) {#SAY Multi Rooms Found. Teleporting to First Room.;#Teleport %item(@Flee.Found,1)} {#SAY No connecting Rooms Found}
1. Flee.Found=""
2. #local $fleeroom
3. $fleeroom=%replace(%1, "'", "''")
4. #FORALL %roomexit() {#ADDITEM Flee.connect %roomlink( ,%i)}
5. #ForALL @Flee.connect {#IF (%ismember( %i,(%mapquery({[Name] LIKE '%$FleeRoom%'})))) {#ADDITEM Flee.Found %i}}
6. #switch (%numitems(@Flee.Found)=1) {#SAY Room found Teleporting.;#TELEPORT @Flee.Found} (%numitems(@Flee.Found)>1) {#SAY Multi Rooms Found. Teleporting to First Room.;#Teleport %item(@Flee.Found,1)} {#SAY No connecting Rooms Found}
|
This is supposed to make the map follow when the character flee's from the room. It has worked up until the upgrade, but has stopped now. I was trying to close and reopen a different cmud map, but now when I open the map, I just get a blank screen that says 'Map for Wheel of Time' and I cannot open map editor, I can't open any maps, or do anything map related. Any help would be appreciated. |
|
Last edited by Toshiro on Thu Dec 27, 2007 12:27 am; edited 1 time in total |
|
|
|
Toshiro Beginner
Joined: 01 Nov 2006 Posts: 14
|
Posted: Thu Dec 27, 2007 12:26 am |
I can't get it to format it, sorry.
|
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Thu Dec 27, 2007 1:03 pm |
Quote: |
I just get a blank screen that says 'Map for Wheel of Time' and I cannot open map editor |
You say that the map is open, but blank, and then that you can't open it. Which do you mean?
I'm not sure how to interpret the script you've posted, either - it'd be really helpful if you could post the XML for the class containing these scripts rather than text you've formatted yourself. I particularly don't understand what the list numbered 1-6 is meant to signify.
However, with that said, it's possible that your problem stems from storing string lists in data record variables, given that the ability for CMUD to nest hash tables (which are now used for string lists and data record variables) has been removed. |
|
|
|
Toshiro Beginner
Joined: 01 Nov 2006 Posts: 14
|
Posted: Thu Dec 27, 2007 8:08 pm |
|
|
Last edited by Toshiro on Thu Dec 27, 2007 8:10 pm; edited 1 time in total |
|
|
|
Toshiro Beginner
Joined: 01 Nov 2006 Posts: 14
|
Posted: Thu Dec 27, 2007 8:09 pm |
The 1's and 2's were ment to follow how it is if you open the package editor and view a script. That's the only way I can enter things like that because the #trigger xx {yy} syntax confuses me if I have to add in more than one string.
Anyway, I also don't get the XML, since it is new (or I haven't opened the editor since beta), but here is the XML code.
Code: |
<module name="FleeScript v2" global="true">
<uid>{543017C4-BCF4-4222-84FA-3A52B162F91C}</uid>
<class name="FleeScript" id="1">
<var name="Flee" type="StringList" id="2">Found4215|4222|4224</var>
<trigger name="FleeTrig" priority="4600" id="3">
<pattern>^You flee head over heels.$</pattern>
<value>Flee=""
Fleeconnect=""</value>
<trigger type="Within Lines" param="1">
<pattern>^(*)$</pattern>
<value>Flee.Found=""
#local $FleeRoom
$FleeRoom=%replace(%1, "'", "''")
#Echo $FleeRoom
#FORALL %roomexit() {#ADDKEY Fleeconnect %roomlink(,%i) %roomname(%roomlink(,%i),)}
#LOOPDB @Fleeconnect {#IF (%begins(%val,$FleeRoom)) {#ADDITEM Flee.Found %key}}
#switch (%numitems(@Flee.Found)=1) {#SAY Room found Teleporting.;#TELEPORT @Flee.Found} (%numitems(@Flee.Found)>1) {#SAY Multi Rooms Found. Teleporting to First Room.;#Teleport %item(@Flee.Found,1)} {#SAY No connecting Rooms Found}</value>
</trigger>
</trigger>
<var name="Fleeconnect" type="Record" id="5"><![CDATA[4215Braem Wood4222Braem Wood4224Braem Wood4217Razorgrass]]></var>
</class>
</module>
|
|
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Fri Dec 28, 2007 3:09 am |
Toshiro wrote: |
<var name="Flee" type="StringList" id="2">Found4215|4222|4224</var>
...snip!...
<value>Flee.Found="" |
As you can see, the variable flee isn't a data record variable, so Flee.Found makes no sense. |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Sat Dec 29, 2007 3:18 pm |
Do you see that funny character that got turned into a square there Fang?
That is what used to force Zmud to change from a string list to a Data Record. I posted about it ages ago...
Anyway Toshiro needs to go in and delete the value of that variable and manually set it to a data record and/or just change the script to use a string list. I'm too lazy to look any deeper but just that char being in the variable could be enough to foobar the script completely. |
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Sat Dec 29, 2007 3:24 pm |
No, I don't - my browser must be parsing it out. How very annoying. Sorry, OP.
|
|
|
|
|
|