|
Loftaris Adept
Joined: 24 Aug 2004 Posts: 277
|
Posted: Fri Nov 01, 2013 2:22 am
Help with gag |
Is there a way to accurately gag a line that MAY or MAY NOT line wrap?
Depending on the monsters name, some lines will have 1 line, some will have 2 lines, but I always want to gag the entire line.
Is there a decent way to accomplish this? |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4690 Location: Pensacola, FL, USA
|
Posted: Fri Nov 01, 2013 9:40 pm |
i use something like this...
Code: |
<trigger priority="500" id="14">
<pattern>part you always see</pattern>
<value>#GAG</value>
<trigger type="Within Lines" param="1">
<pattern>^(%w)</pattern>
<value>#IF (%1=%lower(%1)) {#GAG;#STATE 1}</value>
</trigger>
</trigger>
|
Essentially, it is just checking to see if the next line starts with a lower case word |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Loftaris Adept
Joined: 24 Aug 2004 Posts: 277
|
Posted: Fri Nov 01, 2013 11:55 pm |
So I changed the "part you always see" with the common text I'm trying to gag, but it doesn't gag the remaining line wrapped text.
I even tried changing the ^(%w) with ^(*). (basically waiting for a period to end the line, because the monsters name is at the end of the text)
Your fingers glow red as you reach out and drain mental energy from
the text that line wraps.
Your fingers glow red as you reach out and drain mental energy from creature.
that is an example with/without line wrapping of this one specific example, I do have others with completely different text. |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sat Nov 02, 2013 9:43 pm |
That's what multistate triggers are for.
#trigger "tMentalDrain" {^Your fingers glow red as you reach out and drain mental energy from(*)$} {#if (%ends(%1,".")) {#state tMentalDrain 0};#gagspace}
#condition {^*.$} {#gagspace} {WithinLines|param=1} |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Loftaris Adept
Joined: 24 Aug 2004 Posts: 277
|
Posted: Sat Nov 02, 2013 9:50 pm |
Thank you MattLofton, but it still doesn't work fully, I'll explain:
Sometimes this command happens twice in succession, your trigger will block the first line, the line wrapped line, it will let the 3rd line go through(the triggered part) but it will block the 4th line (the 2nd line wrap.
So instead of seeing:
Your fingers glow red as you reach out and drain mental energy from the
monster you are fighting.
Your fingers glow red as you reach out and drain mental energy from the
monster you are fighting.
what I am seeing is
Your fingers glow red as you reach out and drain mental energy from the
So, why is it completely skipping one of the lines? It could potentially be the first and it's gagging the last 3? But I figured that made less sense than it gagging 1, 2 and 4 and letting 3 go through? |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4690 Location: Pensacola, FL, USA
|
Posted: Sun Nov 03, 2013 4:06 pm |
My example was a multistate trigger, it was just the XML for it instead of zScriipt
if you happen to get an example that went to three lines, the middle line would not get captured in Matt's because of the period
and there is no error checking (testing that the first word is all lowercase) to ensure that its not a stand alone line
does your game indent the wrapped line? because if so we need to account for the whitespace between the line start and the first word:
^%s(%w) |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Loftaris Adept
Joined: 24 Aug 2004 Posts: 277
|
Posted: Sun Nov 03, 2013 9:46 pm |
No, there is no indentation on the 2nd line. All 4 lines of output are on 4 lines, 1 after the other without any type of prompt > or spaces.
|
|
|
|
Loftaris Adept
Joined: 24 Aug 2004 Posts: 277
|
Posted: Tue Nov 05, 2013 12:09 am |
I ~THINK~ I may have figured it out.. I used ~. instead of . in the parameter line and it's seems to work flawlessly...
Thanks very much... I'll let you know if it fails. I really appreciate your guys' help! |
|
|
|
Loftaris Adept
Joined: 24 Aug 2004 Posts: 277
|
Posted: Tue Nov 05, 2013 12:22 am |
I spoke too soon.. it failed again..
It's weird, because now when it fails, whatever comes after the gagged text will be completely omitted for a random amount of times... in this case it's gagging my mud attacks and letting the gagged text go through, so I'm getting my hpbar, shouts, tells, guild communication(basically everything) except my mud hits which coincidentally come right after what's triggered...
Strangest thing..
Uh...... I just checked my triggers, and suddenly there are 183 instances of :
<trigger param="1">
<pattern>^*.$</pattern>
<value>#gagspace</value>
</trigger> |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Tue Nov 05, 2013 2:56 am |
That would be something you were tampering with. Neither of the triggers we gave you would ever create new triggers. My guess is that you created one trigger using the #TRIGGER part of the code, and then in the script code for that you put the #CONDITION command.
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Loftaris Adept
Joined: 24 Aug 2004 Posts: 277
|
Posted: Tue Nov 05, 2013 3:19 am |
actually I made the entire thing through the editor using new trigger then posted it into script text and edited it... fishing that was the wrong thing to do..
I'll check it tomorrow... sorry and thanks |
|
|
|
Loftaris Adept
Joined: 24 Aug 2004 Posts: 277
|
Posted: Wed Nov 06, 2013 1:35 am |
It's working. That copy/paste worked just fine.
Thanks so much guys! |
|
|
|
|
|