 |
ReedN Wizard
Joined: 04 Jan 2006 Posts: 1279 Location: Portland, Oregon
|
Posted: Sun Dec 16, 2007 7:43 pm
#sayp text ending up on the next line which interfers with triggers. |
I have the following text printed with #sayp at the end of a prompt to show the deltas in health:
|0h(0%):-50m(-1%)|
Normally, when I'm not scrolling very fast it looks like this:
4000h, 4390m, 18900e, 24890w exdb-|0h(0%):-50m(-1%)|
However, when text starts coming very quickly it looks like this:
4000h, 5720m, 18900e, 24667w exdb-
|0h(0%):-130m(-2%)|Your vision sharpens with light as you gain night sight.
It put it on the subsequent line with text from other things, which causes a problem because the triggers don't catch the line when it has my health delta at the beginning.
The mechanics of how I do this is that I raise an event called Prompt whenever I match a prompt with either of two triggers which have the same pattern and differ only in that one of the triggers fires off a newline and the other has the prompt option set. I have the newline one there because when text starts coming very fast it won't match of some of the the ones inside the text chunk because Cmud only checks for prompts on boundaries.
If I don't raise a Prompt event off of the newline prompt then I don't get this problem at all. |
|
|
|
 |
Larkin Wizard

Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: Sun Dec 16, 2007 8:18 pm |
Why do you have a prompt trigger that fires on a newline then? In CMUD 2.18, the prompt trigger problems have been remedied, so you don't need two triggers like this to catch them all (so to speak). Using #SAYP on a trigger that ends in a newline will cause the exact behavior shown here, and it should because you're displaying the text AFTER a newline and WITHOUT a newline of its own.
|
|
|
|
 |
ReedN Wizard
Joined: 04 Jan 2006 Posts: 1279 Location: Portland, Oregon
|
Posted: Sun Dec 16, 2007 8:38 pm |
The problem centers around lifevision which in Zmud had this problem:
Prompt
Marked Illusion (changes in state I want to discard)
NewlinePrompt (Not detected with the Prompt option, only if you used the newline option)
Afflictions (changes in state that I actually want to record)
Prompt
===================
If I don't detect the Newlineprompt in the middle then the true afflictions after the Newlineprompt will be thrown out with the marked illusions when I hit the final prompt. The correct thing to do in Zmud is to detect that newline prompt so that I could ignore state changes from the marked illusions and subsequently accept the valid afflictions that come after the NewlinePrompt. This is exactly what I did in Zmud. I have a trigger that detects the Newlineprompt and disposes of any illusions found.
Are you saying that this situation is no longer a problem with Cmud? I have seen Newline prompts that don't match on the Prompt option in Cmud, so that would lead me to believe that this still functions the same as it did in Zmud and is still a problem. |
|
|
|
 |
Larkin Wizard

Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: Sun Dec 16, 2007 9:11 pm |
Yes, I am saying that it's no longer a problem in CMUD. The GA/EOR now triggers properly, even in the middle of a block of text. The problem before was that the block of text wouldn't trigger it because the GA/EOR only mattered at the end of the entire block and the ones in the middle were ignored. Give it a try!
|
|
|
|
 |
Vesence Beginner
Joined: 12 Mar 2006 Posts: 22
|
Posted: Sun Dec 16, 2007 10:37 pm |
What happens if I were to turn off GA/EOR? Would the prompts fire improperly again?
|
|
_________________ Achaea |
|
|
 |
ReedN Wizard
Joined: 04 Jan 2006 Posts: 1279 Location: Portland, Oregon
|
Posted: Mon Dec 17, 2007 1:12 am |
Thanks Larkin, I know you have a good grasp of these things so I feel I can safely take your word for it. I do have a question, though, in that I had done some testing that had made me think that it was the same as Zmud.
What I had done was that I had the two prompt triggers [v2.18], one with the prompt option selected and the other with newline option. I put a print statement in each trigger and held down the return key until I had received a large quantity of prompts. What I noticed was that in CMud that it was exactly the same as in Zmud in that the normal prompt was by far the most often firing trigger, but that at times the prompt one would fail to fire and the newline one would fine in its place.
Was I misinterpreting how to test the GA/EOR issue? I thought the firing of the newline prompt in the burst of text was the exact issue I was grappling with in Zmud. |
|
|
|
 |
Larkin Wizard

Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: Mon Dec 17, 2007 1:40 am |
I won't say it's impossible that a problem still exists with GA/EOR prompt triggers. I know it's a somewhat non-trivial thing to do (ask Nick Gammon why he never did it in MUSHclient, and you'll begin to understand), so you may want to keep your CR/LF trigger around and just not do the #SAYP thing in that one.
|
|
|
|
 |
ReedN Wizard
Joined: 04 Jan 2006 Posts: 1279 Location: Portland, Oregon
|
Posted: Mon Dec 17, 2007 2:15 am |
That sounds reasonable. I'll keep it around and just use it to wipe the execute list if I see an illusion. I guess I just got a bit ambitious with my events and thought I had a great idea to have either trigger raise a prompt event.
|
|
|
|
 |
|
|
|