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
seamer
Magician


Joined: 26 Feb 2001
Posts: 358
Location: Australia

PostPosted: Fri May 23, 2008 6:44 pm   

Upgrading scripts, returning to mudding
 
In zmud I had a trigger based on text like this:
Your blast of frost === OBLITERATES === the raggedy dervish's head! [79]

"blast of frost" is variable
"=== obliterates ===" is variable
the victim is variable, and [79] is variable (only [] would be constant)

cmud doesn't seem to like triggers using (%*)...so whats the correct format now? :)

I tried the compatibility wizard but the thing crashes so I have to bruteforce my way through each trigger..
_________________
Active contributer to coffeemud.net, the advanced java-based mud system.
Reply with quote
shaun.murray
Magician


Joined: 23 Jul 2005
Posts: 334
Location: Chicago

PostPosted: Fri May 23, 2008 6:59 pm   
 
can you post your original trigger? and affect?
Reply with quote
seamer
Magician


Joined: 26 Feb 2001
Posts: 358
Location: Australia

PostPosted: Fri May 23, 2008 7:06 pm   
 
The original trigger is simple:

Your (%*) {@damages} (%*)'s {@bodyparts}(*)
_________________
Active contributer to coffeemud.net, the advanced java-based mud system.
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Fri May 23, 2008 7:08 pm   
 
There really isn't a reason to ever use %* in your trigger pattern. In fact, it can lead to some bad side effects. Change to just * instead.
Reply with quote
seamer
Magician


Joined: 26 Feb 2001
Posts: 358
Location: Australia

PostPosted: Fri May 23, 2008 7:15 pm   
 
We'd be comparing apples to oranges when talking about compatibility and good practises between zmud and cmud.

Thanks though, I'll try that out. :)
_________________
Active contributer to coffeemud.net, the advanced java-based mud system.
Reply with quote
shaun.murray
Magician


Joined: 23 Jul 2005
Posts: 334
Location: Chicago

PostPosted: Fri May 23, 2008 7:29 pm   
 
what is in the variables damages and bodyparts? I'm thinking that it might be a bit too much information. what exactly are you trying to do with that trigger btw?
Reply with quote
seamer
Magician


Joined: 26 Feb 2001
Posts: 358
Location: Australia

PostPosted: Fri May 23, 2008 7:35 pm   
 
Code:
#IF ( @fightcounter > @fight) {
  #IF (@hp < @maxhp) {
    #VARIABLE fightcounter 0
    cast 'cure critical' self
    } {
    gore
    #VARIABLE fightcounter 0
    }
  }
#if (@mana > 100) {
  #IF ("%1" == "blast of lightning") {
    #alarm "fightcounter" +0.75 {
      cast 'lightning breath'
      #add fightcounter 1
      }
    #ABORT 1
    }
  #IF ("%1" == "blast of acid") {
    #alarm "fightcounter" +0.75 {
      cast 'acid breath'
      #add fightcounter 1
      }
    #ABORT 1
    }
  #IF ("%1" == "blast of flame") {
    #alarm "fightcounter" +0.75 {
      cast 'fire breath'
      #add fightcounter 1
      }
    #ABORT 1
    }
  #IF ("%1" == "blast of frost") {
    #alarm "fightcounter" +0.75 {
      cast 'frost breath
      #add fightcounter 1
      }
    #ABORT 1
    }
  #IF ("%1" == "blast of gas") {
    #alarm "fightcounter" +0.75 {
      cast gas
      #add fightcounter 1
      }
    #ABORT 1
    }
  }
#if ("%1" == "divine power") {#abort 1}
#if ("%1" == "flaming bite") {#abort 1}
#if ("%1" == "kick") {
  #if (@fightcounter < 15) {
    #alarm "fightcounter" +0.5 {kick}
    #add fightcounter 1
    }
  }
#if ("%1" == "gore") {
  #if (@gore < 15) {
    #alarm "fightcounter" +0.5 {gore}
    #add fightcounter 1
    } {
    #add fightcounter 1
    gore
    #abort 1
    }
  }
#if ("%1" == "bash") {
  #if (@bash < 15) {
    #alarm "fightcounter" +0.5 {bash}
    #add fightcounter 1
    } {
    #var fightcounter 0
    bash
    #abort 1
    }
  }


#var bodyparts
Code:
(auto)  head|left hand|right hand|face|chest|left forearm|right forearm|right thigh|left thigh|left shin|right shin|left bicep|right bicep|left knee|right knee|left calf|right calf|midriff|left shoulder|right shoulder|claws|fangs|tail|wings|scales|tongue|eye stalks|horn

#var damage
Code:
(StringList)  decimates|<<< STOMPS >>>|wounds|MASSACRES|grazes|pulps|*** EVISCERATES ***|CRIPPLES|FUBARS|*** DEMOLISHES ***|devastates|>>> ANNIHILATES <<<|scratches|injures|mauls|MANGLES|misses|does UNSPEAKABLE|hits|MUTILATES|=== OBLITERATES ===
_________________
Active contributer to coffeemud.net, the advanced java-based mud system.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Fri May 23, 2008 8:06 pm   
 
Part of the problem is probably that the special characters (stars) in the damage types aren't escaped.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Fri May 23, 2008 8:11 pm   
 
Actually, there's a bug in that if you mark it as a string list, it still thinks the ='s are referring to database variables. I mentioned something about it a while back. Don't know if it's been fixed yet, but from the looks of it, it hasn't.

Charneus
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Fri May 23, 2008 8:32 pm   
 
I don't think that's a bug, Charneus. The equal signs are special charactes, just like the asterisks. Both need to be escaped.
Reply with quote
seamer
Magician


Joined: 26 Feb 2001
Posts: 358
Location: Australia

PostPosted: Fri May 23, 2008 8:40 pm   
 
I removed all the special characters (*,=,>) and tried to come up with some proper matching in the trigger. So far no luck.

Anyone have a decent option to try as a trigger?

A round of combat:
Code:

Your blast of frost injures Arnold Schwarzenegger's midriff. [16]
Your slice MUTILATES Arnold Schwarzenegger's head! [39]
The battle falcon's peck injures Arnold Schwarzenegger's left shin.
Arnold Schwarzenegger has a few scratches. (91%)
_________________
Active contributer to coffeemud.net, the advanced java-based mud system.
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Fri May 23, 2008 8:41 pm   
 
Rahab wrote:
I don't think that's a bug, Charneus. The equal signs are special charactes, just like the asterisks. Both need to be escaped.


To this, I reply with:

Zugg wrote:
I think it's the code in the Trigger routine (the one that converts a zMUD trigger into the proper regex and expands the variables) that is causing this. The "=" is causing CMUD to think that you are expanding a database variable instead of a string list. Can someone post a simplified example or test script that will illustrate the bug quickly. This would really help when I get back to bug fixing towards the end of the month.


Taken from here.

Zugg stated it was a bug, so yes, it is a bug. :P

Charneus
Reply with quote
Arde
Enchanter


Joined: 09 Sep 2007
Posts: 605

PostPosted: Fri May 23, 2008 9:14 pm   
 
seamer:

Possibly, you may find several topics nearby as interesting:
http://forums.zuggsoft.com/forums/viewtopic.php?t=30736
http://forums.zuggsoft.com/forums/viewtopic.php?t=30663
http://forums.zuggsoft.com/forums/viewtopic.php?t=30401

Output from the MUD in topics mentioned above is quite similar to your sample. May be it helps you some way...
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Sat May 24, 2008 12:50 am   
 
I was just getting ready to say that Arde. This looks almost exactly like Chamenas' trigger.
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