|
acaykath Wanderer
Joined: 03 Aug 2005 Posts: 84
|
Posted: Wed Nov 29, 2006 4:35 am
[1.16/7] Triggers Randomly not Fireing |
I have a complex script that worked fine up to 1.14 (1.15 had the 1s and 0s screwing it up) but as of 1.16/1.17 some of the triggers have just stopped firing. Sometimesrestarting cMud will fix the trigger fireing problem for one trigger, but another will stop fireing. These triggers do not even fire if Icopy and paste their pattern and paste it after the #fire command. One trigger that does this regularly is the following:
Code: |
Pattern:
A Golden Maiden is DEAD!!
Code:
#IF (nuggets<20) {
cast 'carnal reach' gold maiden
}{
recall
.2s3w2nen
craft 'olympian bar of pure gold'
}
Flags/Settings:
Pattern
Trigger on Trigger
Trigger on Newline
|
If anyone knows why my trigger isn't fireing, please tell me so I can fix it.
typing #fire "A Golden Maiden is DEAD!!" or #fire A Golden Maiden is DEAD!! results in absolutely nothing happening. |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Wed Nov 29, 2006 5:11 am |
You should have a space between the braces '}{'...'} {'. Have you checked the compiled tab to make sure the script compiles?
|
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
acaykath Wanderer
Joined: 03 Aug 2005 Posts: 84
|
Posted: Wed Nov 29, 2006 2:17 pm |
Yep, the lack of space was causing it not to compile... the not fireing in this case is pretty un-user friendly perhaps if it cant compile the code, it should just send the text to the mud rather than not fireing. At least that way t would give an idea that there was a problem with the code.
|
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Wed Nov 29, 2006 2:35 pm |
I do agree that sometimes it's not obvious that a script hasn't compiled, especially if it's a very simple script and you've only made a minor mistake like this one. Perhaps there could be some kind of notification on the first tab as to whether or not it's compiled ok?
EDIT: The other thing I'd suggest checking is your indentation. In this example, you don't need any indentation at all, they can all simply be on separate lines. Indentation's only needed if you want to have CMUD ignore the break for some reason, and it can cause some funny behaviour if you indent too much when you don't need to. I had some comments in my script go all funny because I'd done the indentation wrong. I remember a couple of times in the past I think where indentation problems caused the script to not do anything, too, which is why I suggest it. |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Nov 29, 2006 6:10 pm |
I've played with just sending the text from scripts that don't compile, but it was generally considered a bad idea. Remember when aliases that didn't compile sent their script to the MUD? People had all sorts of problems with this because it spams the MUD with crap and can cause bad things to happen to your MUD character.
I'll probably do the samething that I did with aliases and bring up an error message instead. I don't tend to like error messages from triggers, because they can pop up at annoying times, but it's probably better than just ignoring the error. |
|
|
|
The Raven Magician
Joined: 13 Oct 2000 Posts: 463
|
Posted: Wed Nov 29, 2006 6:11 pm |
I disagree Fang, his indentation is perfect. The purpose of indentation is to identify block level. I use his type of indentation all the time, and it compiles perfectly.
|
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Wed Nov 29, 2006 6:15 pm |
It's not a matter of agreeing or disagreeing, Raven, I'm simply saying that using indentation that wasn't absolutely needed has caused problems for me in the past, so he should consider checking it.
|
|
|
|
The Raven Magician
Joined: 13 Oct 2000 Posts: 463
|
Posted: Wed Nov 29, 2006 6:18 pm |
Zugg, why not having some prominent notice on the first tab when it is not compiling? Like, if they stop typing for 3 seconds, and it still doesn't compile, make the border red, or make the Compiled tab flash.
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Nov 29, 2006 6:28 pm |
Fang: Just because indentation caused problems because of bugs in past beta versions doesn't mean we should be discouraging it's use. It's important to use indentation to make scripts more readable. If there are still problems caused by indentation then they need to be reported and fixed.
Raven: Unfortunately, it's hard to predict how long it takes to compile, so this could slow down the editor. Also, I tried doing this in zMUD (which is what the syntax checking in zMUD did...parse it in the background) and it's a real pain dealing with the errors that are naturally caused when you are in the middle of creating a script. Most scripts won't compile when you are in the middle of typing them, even if you pause with your typing. So I don't want to do anything that is too intrusive.
After the public release when things are working better, then I'll be in a better position to do fancier stuff like that. But I even if I did that, I still think some sort of error message is needed, because you might have created a trigger from the command line that doesn't compile and would have never seen it in the settings editor. |
|
|
|
The Raven Magician
Joined: 13 Oct 2000 Posts: 463
|
Posted: Wed Nov 29, 2006 6:52 pm |
How about the reverse then Zugg... rather than a warning 'OMG, you suxxor' when it doesn't compile, you could put a green 'No Errors' up when it compiles successfully. When they type you take away the 'No Errors' sticker until it works again. People would quickly learn to check for that before they expected it to work, but it wouldn't annoy them while they were typing.
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Nov 29, 2006 7:01 pm |
That's a good idea and certainly sounds like a better way of handling it.
|
|
|
|
Rainchild Wizard
Joined: 10 Oct 2000 Posts: 1551 Location: Australia
|
Posted: Wed Nov 29, 2006 9:23 pm |
Also, can we toggle an option to have the error text in-line in the "status" colour that zMUD uses... something like
You are mildly hungry.
>> ERR: Trigger #1234 in //MyModule/MyClass fired but a compile error prevented it from running.
Same thing for a failed alias... when we're dealing with a MUD since everything is text I'd prefer to not have a pop-up box which takes you away form the game... plus something in the scrollback buffer means you can move to somewhere safe, scroll back up to the error and still have the reference without having to write it down from the pop-up box. |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Nov 29, 2006 10:35 pm |
Rainchild, that's a good idea and something that I'll look into. Right now the compiler doesn't have any way to display a message in the MUD window, but I can probably fix that.
|
|
|
|
|
|