About Us
Products
Purchase
Downloads
Support
Forums
Contact Us
Site
 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
Nattie
Apprentice


Joined: 24 Jul 2008
Posts: 109

PostPosted: Tue Jul 29, 2008 9:02 pm   

[2.34] A few triggers have stopped firing properly
 
These triggers worked before I upgraded today. I haven't changed anything relating to them, or in their classes or parent classes. Their class and parent classes are enabled. They do not have names, so they don't have names that would conflict with anything.

Lines that are supposed to trigger them don't. I tried copying and pasting the line into the trigger tester and confirmed that it should have fired. I tried doing a #SHOW of the line and it does not fire. I put an #ECHO on the trigger to be sure the trigger was literally not firing, rather than there being a problem saving the things to variables. It's just not firing. I tried several test lines in the tester, then as #SHOWs, nothing. :-/ Other triggers in the class fire.

Here they are:

Code:
#TRIGGER {^You begin to listen to (%w) teach the (%w %w) skill.$} {#VAR teacher %1;#VAR subject %2;#VAR pupil 1}
#TRIGGER {^You begin to listen to (%w) teach the (%w) skill.$} {#VAR teacher %1;#VAR subject %2;#VAR pupil 1}


I tried opening and closing the program several times just in case it was a temporary thing. Any ideas?
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Tue Jul 29, 2008 9:41 pm   
 
What text are they not firing on? Are you sure that they are enabled? Also have you looked at the compiled tab to ensure they triggers compile successfully?
_________________
Asati di tempari!
Reply with quote
Nattie
Apprentice


Joined: 24 Jul 2008
Posts: 109

PostPosted: Tue Jul 29, 2008 9:48 pm   
 
They compile successfully. They are enabled. Their classes are enabled. Their parent classes are enabled.

The first one, for example, will not trigger off this: "You begin to listen to Someguy teach the Mechanical Lore skill." Pasting it into the trigger test works, and it shows %1 and %2 correctly. It just doesn't fire when it gets that text from the game.

Same thing for the second one with this: "You begin to listen to Someguy teach the Lockpicking skill."
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Tue Jul 29, 2008 10:37 pm   
 
Personally, that looks like a screwy trigger to begin with. I'd change it to:

#REGEX {^You begin to listen to (\w+) teach the (\w+(?: \w+)?) skill.} {#VAR teacher %1;#VAR subject %2;#VAR pupil 1}

That way, it's only one trigger, and it'll match Mechanical Lore, lockpicking, or whatever other skill you're working on.

Charneus
Reply with quote
Nattie
Apprentice


Joined: 24 Jul 2008
Posts: 109

PostPosted: Tue Jul 29, 2008 10:51 pm   
 
Thanks, charneus! That works perfectly. :-)

If I can ask, what makes it screwy? I just started recently learning REGEX so most of my triggers are not REGEX. I would like to go back and change my other triggers where necessary, but I'm not very good at identifying what makes a #TRIGGER better suited to be a #REGEX. For example, when I look at "^You begin to listen to (%w) teach the (%w) skill.$" it seems pretty straightforward, but since I keep getting these weird "bugs" I feel like it's probably a lack of understanding on my part.
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Tue Jul 29, 2008 11:59 pm   
 
Perhaps "screwy" is a term I shouldn't have used. It's messy, more or less.

Using the regex, it is a bit cleaner than using two triggers. It's doing the same thing as the two triggers individually, but it's going to do it much faster. Take, for instance, your problem.

You begin to listen to Someguy teach the Lockpicking skill.

It matches the first trigger quite a bit: "You begin to listen to Someguy teach the Lockpicking skill" matches "You begin to listen to (%w) teach the (%w %w)" portion of the trigger. However, it also matches "You being to listen to (%w) teach the (%w) skill." as well, so now CMUD has to determine which one you were referring to. CMUD is pretty smart, but even it can make mistakes. :P

With the regex, it can still match both of them in the same fashion, but now it just backtracks on the last two words to see if it matches at all.

Probably not a very good explanation (I suck at those) but perhaps you can understand what I'm trying to get across. It may not be how it is in the books, so to speak, but that makes the most sense to me, even if I got it all wrong. At least I can visually see the difference. ;) Maybe someone else can go into more detail, or say I'm wrong, or anything like that.

Charneus
Reply with quote
Caled
Sorcerer


Joined: 21 Oct 2000
Posts: 821
Location: Australia

PostPosted: Wed Jul 30, 2008 8:30 am   
 
I would have used a single trigger with (*) instead of the (%w %w).
#tr {^You begin to listen to (%w) teach the (*) skill.$} {blah}

I'm not saying thats better than the regex example, but for people with no clue about regex (the majority of users, I bet) that is pretty much how you go about matching that pattern.

A little more specific would be to use a range with a space: [A-z ] but its not like that trigger is pattern insensitive to begin with. With so many words matching directly before the wildcard is reached, the wildcard will almost never be tested against a non-true pattern anyway, meaning its fine to use *.

If I understand it correctly anyway.
_________________
Athlon 64 3200+
Win XP Pro x64
Reply with quote
Nattie
Apprentice


Joined: 24 Jul 2008
Posts: 109

PostPosted: Wed Jul 30, 2008 3:20 pm   
 
I tried using (*) when (%w %w) didn't work, and having only the single trigger, and for some reason that didn't work either. Really stumped me, heh.
Reply with quote
Nattie
Apprentice


Joined: 24 Jul 2008
Posts: 109

PostPosted: Wed Jul 30, 2008 7:08 pm   
 
I added this one today and it's the same thing... test trigger says it should fire, but it doesn't fire when it gets the text from the game, and it doesn't fire when I do a #SHOW to test it either. :(

Code:
#TRIGGER {^You stop listening to @teacher.$} {#VAR teacher "";#VAR subject "";#VAR pupil 0}


That's a pretty straightforward trigger, right? I feel like I'm getting a lot of stuff like this, where things just aren't working, and I get errors pretty frequently, even with scripts that work fine for days. I probably have to close and re-open the program a couple dozen times a day. Sometimes it seems like I've done something wrong, or didn't understand something, and I'm happy to learn from that and fix it. Sometimes people give examples of other ways to do it and that's awesome and I appreciate that, too. But it seems like maybe a third of the time there's just no obvious reason why something isn't working (even if I get another way to do it) but no one else seems to have the problem. :-/ Bear with me here because I'm getting to my point after these examples. As a disclaimer, I'm not saying that CMUD is a super-buggy program or something. This seems to be only happening to me, and I just want to figure out why.

The king of weird "bugs"/errors I get all the time:

For example, I'm using the #REGEX suggested above in lieu of the two triggers I posted, and it works and I'm grateful. But still, why do those triggers not work when they worked before? Is it really just because they start with similar text? :-/ I have other triggers that start with similar text and they work fine (at least right now). I'm trying to be more careful about it, regardless, but... I guess I don't understand why it wouldn't see that the text either matches the trigger or doesn't. And if it was somehow confused and thought they both matched, wouldn't it just fire both? I've had more than one trigger fire off the same line and even pattern. And it still puzzles me that if I copy and paste stuff into the tester, it says it should work.

Another example is the thing I posted where events just do not work for me. I can copy and paste the exact same text to an alias and it works, but it will not work as an event. I just get all kinds of weird errors if I try to run anything as an event. I make sure nothing is named the same as anything else, etc, and it doesn't seem to matter. (FWIW, the documentation claims events do not need unique names, but when I've named them the same thing as an alias or class all hell has broken loose. Changing the name fixes those particular bugs.) The events will pick a random point and abort when I have no commands to abort anything and haven't entered anything to manually stop a thread. I just don't understand it. :-/ Every time I run an event it will do something completely different, and abort at a different spot. That... shouldn't happen, right? If it works as an alias, shouldn't it work as an event? (If I'm wrong there, please say so; no one said anything to that effect on the other thread so if I don't understand that there are some things you can't/shouldn't do in events, that would save me a lot of headache. Also if events are supposed to be really short, or something, that would be helpful to know. I've read the event documentation several times over and found nothing. :-/) So for now I am working around not using events, but I really want to use them and later I will need to use them.

Then there was the thing where sometimes things would not #UNTRIGGER but I could do it from the command line fine. Zugg explained to me why my triggers with ~ in it would not work this way, and how particularly long trigger patterns would need to be named. It was great to know that because I could fix a decent amount of things. I still wonder, though, why sometimes short triggers with no special characters in them would not untrigger...? Is there some other reason or is it a bug? I don't know.

Then sometimes triggers would randomly not be creating in the class they were told to be created in. Oldguy2 pointed out that I should be enabling and disabling triggers rather than creating and destroying them, so I did and I just don't have to deal with that anymore. I'm grateful not to have to worry about triggers not being created in their class. But still, why was it doing that? If it gets the command to create a trigger, and there is a class attached to it, why does it sometimes ignore it and sometimes not? And this was always completely different triggers.

Another example: every time I open the mapper I get spammed with errors every several seconds, even if I don't load a map. Loading a map makes things worse. And then I can close the map in follow mode, and open the map in follow mode, and sometimes some links will have spontaneously changed. This seems weird, right? When I haven't touched the map at all, and I have no scripts that access the mapper in any way? :-/ Another weird thing is sometimes speedwalking does not work. I have it check for room names, and every single time I load the mapper, it picks a different room where it will always hang, and often only in one direction (although sometimes more). I double check the room and the name is exactly what it says in the game. Even the description is the same. I have tried manually copying and pasting the text from the game over the room description, just in case a single space was off or something. Never works. I have tried going into edit mode, deleting the room, and manually recreating it. Never works, still hangs. In a few days, the room might work again while another one breaks, even if I haven't opened the map or done anything. So I pretty much can't use the mapper.

Now, after the upgrade, I have a gauge that will spontaneously quit updating. Its caption is a variable and the variable changes fine, it's just the gauge itself gets frozen. Sometimes disabling it and re-enabling it fixes it. Sometimes I have to disable and enable it multiple times. Then sometimes it freezes again immediately, or times it works the whole session.

I'm always careful to exit the program whenever I get an error so I'm not getting messed up by any residual weirdness, too.

I have a lot of patience when I feel like I've screwed something up, or misunderstood something, because then I can fix it. I have a lot of patience when something just isn't possible, or when something is simply a bug and other people get it too, because I don't expect programs to be perfect and at least the issue is temporarily settled. I guess what's difficult about this is that other people do not seem to get this many bugs/errors, and do not seem to have these same bugs/errors. As such, I've been reluctant to call anything a real "bug."

It seems like the best thing for me to do is try and figure out why I'm getting these slews of errors and other people do not. Is it possible I have a messed up install or something? :-/ Is there anything else that would cause me to get a lot of weird errors, but not other people? I don't think my scripts do anything particularly weird...
Reply with quote
Nattie
Apprentice


Joined: 24 Jul 2008
Posts: 109

PostPosted: Wed Jul 30, 2008 8:34 pm   
 
Well, I backed everything up, double-checked that all other programs were closed, uninstalled CMUD, reinstalled CMUD, and then restored my session.pkg, session.tbz, and session.xly files. I renamed the default ones as well so I can test things.

If I get less errors this time around, it will at least be a hint that maybe something was wrong with my install. I checked the RAM the morning with no errors, so I know it isn't that.

I'm going to start going through and testing some things, like seeing if events will work for me now, and if the mapper is runs more stably.
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Wed Jul 30, 2008 8:52 pm   
 
Sounds like you need to do a clean install. Those triggers all work fine for me. Of course I can't see the real input from your MUD either. Try copying that line directly from your screen and paste it directly into a trigger pattern and see if it is the same.

One thing I will say is that half the time I forget what the heck I am doing and certainly no expert at scripting like Vijilante and others. I'm very good at just looking at something and figuring it out in a second or two, but when I try to come up with complicated stuff myself, I lose track of where I was. I used to get frustrated at why stuff wasn't working, and like you was afraid to report it as a bug or something because I thought I would look like a dumbass. So I would say I have no idea what is going on or why it is happening and thought I looked like a dumbass anyway and no one would believe me. Yet many times it was simply because my settings got corrupted somehow. So Zugg would say it sounds like your settings got corrupted or to do a clean install. So I would and everything would be fine. Now I never update directly. I always do a complete clean install and never have any problems unless it really is a bug.
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Wed Jul 30, 2008 8:53 pm   
 
Bleh you already did I guess. lol
Reply with quote
Nattie
Apprentice


Joined: 24 Jul 2008
Posts: 109

PostPosted: Wed Jul 30, 2008 8:57 pm   
 
Haha, thank you, that makes me feel better. :-)

So far I've haven't had an outright error box, but I'm having the same problem with events. :( I'm gonna go bump that other thread...
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