Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
estelle
Newbie


Joined: 26 Sep 2010
Posts: 8

PostPosted: Fri Nov 19, 2010 1:59 am   

pattern matching suddenly not dumping into database
 
Hiho

I had a nice little multistate trigger to track my spell improves. Upon seeing "you improved the spell" it asks for an output of my spell list, finds the name of the spell I was practicing (@spellname) and passes the line containing that name to the second state of the trigger. The line looks something like this:

Glittering Dust glitter verbal&gesture 6 lousy

It ignores the fancy spell name (Glittering Dust) and finds the @spellname (in this case, "glitter"), pattern matches that and the next three variables like so:

(@spellname) %s (*) %s (%x) %s (%w)

When I look at the captured subpatterns I see, just as I expect:

%1: glitter
%2: verbal&gesture
%3: 6
%4: lousy

Hurray! It is then supposed to dump @spellname, %time, @failures (calculated elsewhere), %4, and @failrate (calculated elsewhere) into the database "improves" via the following script:

#new improves {spell=@spellname|time=%time(c)|failures=@failures|level=%4|failrate=@failrate}

And it did! Perfectly! Until....I a) had to rebuild my machine from XP to Win7 (clean install) and b) downloaded the most recent build of cmud (3.32). Since then it creates the new record, puts the @spellname variable in the right place, but nothing else. I have a third state to the trigger that does a simple echo on the screen and that works fine.

Woe is me. I have double checked that all the calculated variables are correctly registered, and in fact, I can echo them to the screen...they just *will not* dump into my database. What up?

Thanks in advance, smart types :)

-Estelle
Reply with quote
darmir
Sorcerer


Joined: 10 Oct 2000
Posts: 706
Location: USA

PostPosted: Fri Nov 19, 2010 3:10 am   
 
Estelle,
Can you post the the complete trigger. Just goto your trigger in the editor click on the XML tab, highlight the text and post it in the code tags. Also give us the text from the mud too. Make sure you place it in the code tags also.
_________________
Run as hard as a wild beast if you will, but you won't get any reward greater than that destined for you.
Source: (Egyptian)
Reply with quote
estelle
Newbie


Joined: 26 Sep 2010
Posts: 8

PostPosted: Fri Nov 19, 2010 3:30 am   sure thing....
 
here's the trigger:


Code:

<trigger priority="5710" id="270">
  <pattern>You improved the spell</pattern>
  <value>spells
$sa SPELL IMPROVE: %time(c) @spellname
improvestate=1</value>
  <trigger case="true">
    <pattern>(@spellname) %s (*) %s (%x) %s (%w)</pattern>
    <value>#new improves {spell=@spellname|time=%time(c)|failures=@failures|level=%4|failrate=@failrate}</value>
  </trigger>
  <trigger>
    <pattern>wind</pattern>
    <value>#sa SPELL IMPROVE: %time(c) @spellname %4</value>
  </trigger>
</trigger>



Note that I have the $ replacing the # for my command character, but that only works in the 1st state, after that I have to revert back to the #.

The only mud output I get is my spell list, and the echos at the top and bottom, but here goes:

Code:
> You say in xyllic: you improved the spell
SPELL IMPROVE: 11/18/2010 9:27:42 PM glitter
>
SPELLNAME             SYNTAX       FORM                  TIME     MASTERY
Aware of Time         aware        mental                1        impressive
Barrier               barrier      gesture               6        impressive
Breathe water         breathe      verbal&gesture        4        impressive
Energy Constitution   constitution mental                5        impressive
Creature Call         crcall       mental                4        impressive
Creature Combat       crcombat     gesture               17       quite good
Create duplications   creation     verbal&gesture        26       very good 
Create Creature       creature     gesture               15       impressive
Darkness              dark         verbal&gesture        3        impressive
Detect Magic          detect       mental&gesture        11       impressive
Floating Disc         disc         verbal&gesture        4        impressive
Dispel Magic          dispel       mental&gesture        4        impressive
Determine Master      dmaster      mental                5        impressive
Earthquake            earthquake   mental&gesture        8        impressive
Enchant               enchant      verbal                15       impressive
Energy Cloud          energy       mental                9        perfect   
Call Familiar         familiar     verbal&gesture        22       impressive
Far See               farsee       mental                9        impressive
Far Sense Potential   farsense     mental                18       impressive
Fear                  fear         mental                6        impressive
Fireball              fire         verbal&gesture        4        impressive
Fire Shape            fireshape    mental                9        impressive
Fire Wall             firewall     mental&gesture        6        impressive
Create Food           food         gesture               8        impressive
Weather Forecast      forecast     mental                1        impressive
Glittering Dust       glitter      verbal&gesture        6        rudimentary
Globe of Light        globe        verbal                3        impressive
Heal Other            heal         mental                3        impressive
Iceshard              iceshard     verbal&gesture        4        impressive
Identify Item         identify     mental&gesture        11       impressive
Inferno               inferno      mental&gesture        7        perfect   
Invisibility          invisible    verbal                5        impressive
Infravision           ivision      mental                3        impressive
Light an item         light        verbal&gesture        5        impressive
Out of View           offview      gesture               7        impressive
Preserve Flesh        preserve     verbal&gesture        8        impressive
Recall Staff          recall       verbal&gesture        11       impressive
Recharge Item         recharge     verbal&gesture        11       impressive
Magic Resistance      resist       mental&gesture        5        impressive
Magic Look            see          mental                3        perfect   
Summon Elemental      selemental   verbal&gesture        7        impressive
Sense Potential       sense        mental                1        impressive
Sharpen Weapon        sharpen      mental&gesture        4        impressive
Magic Shield          shield       verbal&gesture        3        perfect   
Magic Silence         silence      gesture               2        impressive
Spell Bind            spellbind    verbal&gesture        15       impressive
Blue Stone            stone        mental                15       impressive
Icestorm              storm        verbal&gesture        5        perfect   
Strength              strength     verbal&gesture        6        impressive
Energy Strengthen     strengthen   mental                7        impressive
Airstrike             strike       verbal&gesture        3        impressive
Summon Fenris Wolf    swolf        verbal&gesture        8        impressive
Telecinectics         telec        gesture               4        impressive
Teleportation         teleport     mental&gesture        15       impressive
Magic Tell            tell         mental                0        impressive
Healing Touch         touch        verbal&gesture        5        impressive
Superior Healing      touch+       verbal&gesture        8        perfect   
Astral Travel         travel       gesture               8        impressive
Shape Change          turn         mental&gesture        8        impressive
Create Ward           ward         gesture               7        impressive
Create Water          water        gesture               8        impressive
Weaken your enemy     weaken       mental                10       good       
Magic Web             web          gesture               5        impressive
Circling Winds        wind         verbal&gesture        6        impressive
SPELL IMPROVE: 11/18/2010 9:27:42 PM glitter

-> Use cast <name> or c<name> to cast a spell and spell <name> for help <-


Thanks!!
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Fri Nov 19, 2010 1:43 pm   
 
Early in your code, you have:
Code:

$sa SPELL IMPROVE: %time(c) @spellname

Should that be #sa instead of $sa?
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Fri Nov 19, 2010 1:48 pm   
 
I don't see any other oddities in your code. It's been a long time since I used the internal database, but your #new command seems to conform to the documentation. You could try reformulating that command as:
Code:

#new improves spell=@spellname time=%time(c) failures=@failures level=%4 failrate=@failrate

According to the documentation, it should work either way, but I have a vague memory of someone else having trouble with the other format.
Reply with quote
estelle
Newbie


Joined: 26 Sep 2010
Posts: 8

PostPosted: Fri Nov 19, 2010 4:47 pm   
 
Whee! That did it. Thank you!
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
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