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
Loftaris
Adept


Joined: 24 Aug 2004
Posts: 277

PostPosted: 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?
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4690
Location: Pensacola, FL, USA

PostPosted: 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
Reply with quote
Loftaris
Adept


Joined: 24 Aug 2004
Posts: 277

PostPosted: 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.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: 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
Reply with quote
Loftaris
Adept


Joined: 24 Aug 2004
Posts: 277

PostPosted: 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?
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4690
Location: Pensacola, FL, USA

PostPosted: 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
Reply with quote
Loftaris
Adept


Joined: 24 Aug 2004
Posts: 277

PostPosted: 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.
Reply with quote
Loftaris
Adept


Joined: 24 Aug 2004
Posts: 277

PostPosted: 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!
Reply with quote
Loftaris
Adept


Joined: 24 Aug 2004
Posts: 277

PostPosted: 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>
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: 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
Reply with quote
Loftaris
Adept


Joined: 24 Aug 2004
Posts: 277

PostPosted: 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
Reply with quote
Loftaris
Adept


Joined: 24 Aug 2004
Posts: 277

PostPosted: Wed Nov 06, 2013 1:35 am   
 
It's working. That copy/paste worked just fine.

Thanks so much guys!
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