 |
talonnb Apprentice
Joined: 30 Oct 2004 Posts: 127
|
Posted: Sat Mar 22, 2008 9:40 pm
There a reason this trigger slows down Cmud so much? |
^{A|*}{*| }{*|p}{r|*}{*|i}{c|*}{k|*}{l|*}{y|*}{*| }{s|*}{t|*}{i|*}{n|*}{g|*}{i|*}{n|*}{g|*}{ |*}{o|*}{v|*}{e|*}{r|*}{w|*}{h|*}{e|*}{l|*}{m|*}{s|*}{*| }{y|*}{o|*}{u|*}{r|*}{ |*}{b|*}{o|*}{d|*}{y|*}{,|*}{*| }{f|*}{a|*}{d|*}{i|*}{n|*}{g|*}{*| }{a|*}{w|*}{a|*}{y|*}{*| }{i|*}{n|*}{t|*}{o|*}{*| }{n|*}{u|*}{m|*}{b|*}{n|*}{e|*}{s|*}{s|*}{.|*}
#if (@attacked <= 0) {#echo ILLUSION!!!}
#if (@attacked > 0) {
#var plants.paralysis 1
#var plants.planthit 1
}
#var attacked [@attacked - 1]
Basically the message varies each letter with *, hence the bunch of varying. Can Cmud not handle this well? Is there another way I should put this? |
|
|
 |
Fang Xianfu GURU

Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Sat Mar 22, 2008 10:02 pm |
Firstly, the [] syntax has been removed (see the help).
What do you mean by slowing down? The package editor is pretty slow just because there're lots of different things to highlight (it's actually highlighting some things wrong, which might be something to look into). Is that what you meant, or is the trigger actually executing slowly? |
|
|
 |
talonnb Apprentice
Joined: 30 Oct 2004 Posts: 127
|
Posted: Sat Mar 22, 2008 10:05 pm |
Yeah, sorry, I already deleted the [ ] but try putting it in your system and you'll see what I mean. The system 'drags' like.....so bad
|
|
|
 |
Fang Xianfu GURU

Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Sat Mar 22, 2008 10:12 pm |
I pasted it into the editor and noticed that it's very slow to change tabs and things with that trigger highlighted. Is that what you meant? I didn't notice any significant slowdown in matching speed.
EDIT: Wow. Opening and closing the package editor with that trigger highlighted and changing flags like enabled on it is very slow. |
|
|
 |
talonnb Apprentice
Joined: 30 Oct 2004 Posts: 127
|
Posted: Sat Mar 22, 2008 10:26 pm |
My point exactly. Oh well, might try another way to add it....although can't think of another way at the moment. Is there another way to vary things like this?
The triggered line is:
A prickly stinging overwhelms your body, fading away into numbness.
But the game varies the letters to * so you could see:
A pr*ckly sti*ging ove*wh*lms your *od*, f*din* awa* int* nu**ness.
So, is there another way? |
|
|
 |
shalimar GURU

Joined: 04 Aug 2002 Posts: 4721 Location: Pensacola, FL, USA
|
Posted: Sat Mar 22, 2008 11:41 pm |
Too bad we dont have inverse triggering...
i mean if:
A pr*ckly sti*ging ove*wh*lms your *od*, f*din* awa* int* nu**ness.
was the pattern it WOULD match:
A prickly stinging overwhelms your body, fading away into numbness.
But i suspect it would be rather slower to treat the incomming text as the pattern and test it against a wildcard free trigger |
|
_________________ Discord: Shalimarwildcat |
|
|
 |
luggage Novice
Joined: 20 Jul 2004 Posts: 38 Location: Australia
|
Posted: Sun Mar 23, 2008 12:52 am |
I can only think of one other way of doing it, which involves a bit of mick-mucking around.
Basically, the number of characters in the line is always going to be the same, so you could trigger on a fixed pattern length.
Then I would also incorporate into the same trigger several character range checks for say every word and the space.
This will pick up that line, but maybe another one as well, so then in the trigger you would have to double-check if it is exactly the prickly stinging.
Basically (untested) something like:
#TRIGGER {^&2[A* ]&8[prickly* ]&9[sting* ] .... etc
Will trigger on that line, but possibly on more lines as well. Also, this won't slow down the editor much either. :) |
|
|
 |
Vijilante SubAdmin

Joined: 18 Nov 2001 Posts: 5182
|
Posted: Sun Mar 23, 2008 2:12 am |
Actually I am thinking the best way to handle this is really with script. Since you already have something that detects being attacked you know when to enable the match. If you use a null pattern or equivalent it will match each line.
Code: |
#REGEX "paralysed" {^} {
//Next you do the fastest check possible to throw the line out, that being its length.
#IF (%len(%line)=67) {
//Now it looks like the inverse matching would be a good idea.
#IF (%match("A prickly stinging overwhelms your body, fading away into numbness.",%line)) {
//Finally your code
plants.paralysis=1
plants.planthit=1
attacked=(@attacked - 1)
}
}
} |
|
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Mar 24, 2008 4:35 pm |
Also try turning off the Syntax Highlighting option in the editor menu. I think it's the color syntax highlighting of the pattern that is causing the slowdown.
|
|
|
 |
oldguy2 Wizard
Joined: 17 Jun 2006 Posts: 1201
|
Posted: Sun Aug 03, 2008 3:25 am |
Nevermind. I had the stupid class folder the trigger was in off while testing. lol I was going to say it won't work for me.
|
|
|
 |
Seb Wizard
Joined: 14 Aug 2004 Posts: 1269
|
Posted: Sun Aug 03, 2008 4:00 am |
Bah, ninja'd by edit.
Ideally one should replace the %line in:
#IF (%match("A prickly stinging overwhelms your body, fading away into numbness.",%line)) {
with:
%replace(%line,"*","?")
but that would only make it faster (I presume, but maybe it's actually slower due to the replacing time) and less likely to have a false match. I don't know why it's not matching. Have you tried using the debugger? OK, I decided to debug it myself (next time you try this first though, promise?) and found that it works fine for me using a #SHOW command to trigger it, so maybe the text is not the same? Try it with the debugger and put some variables you set to see how far you get (you can't print or you mess up %line). |
|
|
 |
|
|