 |
Vitae Enchanter

Joined: 17 Jun 2005 Posts: 673 Location: New York
|
Posted: Mon Sep 11, 2006 11:09 am
#temp vs #trigger |
Is there any advantage that one has over an other?
With a named trigger you can just turn it on and off with the #T-/T+ but can have tons activated potentially slowing your commands down. I've tried a roster script on a blank char file with NO other triggers except those for the roster and it actually would not work because I had so much less lag. I had to go back to the regular one so that my lag would allow the use of the script.
With a #temp you don't have as many triggers lying around but if they don't trigger then they accumulate. I've had times where I had several hundred unactivated #temps. And also found it rather hard to easily locate the #temp since it was in a trigger or an alias.
I'm kinda split over which i prefer. I think that I have a ratio of 1 #temp for every 25 triggers.
So, just curious, which is better/preferred, and why? (this is strictly an opinion question, don't start flaming eachother) |
|
|
 |
shalimar GURU

Joined: 04 Aug 2002 Posts: 4772 Location: Pensacola, FL, USA
|
Posted: Mon Sep 11, 2006 12:58 pm |
I usually use a temp for cleanup scenarios, granted, you could use a disabled trigger for the same effect, but temp's wont clutter up the editor and makes it easier (for me) to see what all i have at a glance.
I also to name my temp's and stick them into a temp class so if needed i can '#DELCLASS temp' |
|
_________________ Discord: Shalimarwildcat |
|
|
 |
Vijilante SubAdmin

Joined: 18 Nov 2001 Posts: 5187
|
Posted: Mon Sep 11, 2006 10:56 pm |
One of the disadvantages to #TEMP's is the initial creation time. This has a few steps such as assigning memory for the trigger and registering & compiling the pattern text into a regex. I am sure there are probably more steps, but it gives you an idea that each time a temp trigger is created it takes some time. The enabling and disabling of a trigger though is only a matter of setting a flag. However every line of text that comes in requires that the flag be checked for every trigger, and then the pattern tested when appropiate. So as you have seen the speed decreases with the increased number of triggers.
Perhaps Zugg will or has already improved the method by which this is done in CMud to use more memory. By storing a full list of enabled triggers and simply adding and removing to that list a minor speed gain might be realised during most trigger operation. #Tą would be somewhat slower then it is now though. |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
 |
Vitae Enchanter

Joined: 17 Jun 2005 Posts: 673 Location: New York
|
Posted: Tue Sep 12, 2006 12:38 am |
Shalimar,
Good idea on the class.
Vij,
Thanks for the info on the #temp creation time. For some reason i thought that it was created quickly. (quickly as in much less lag time than you imply, we all know that it's quick in the 1st place)
So does that mean that that might be the reason behind the missed activations on the #temps? The fact that the effect might have passed before the #temp is created?
As for the speed issue, I've been making extensive use to turning off my triggers with the #T+/- and have not seen any real increase in my speed. (yes, I've tried the ctrl-q thing with triggers on and triggers off)
I MIGHT be wrong, but I think I remember making a test .mud file which had all of my triggers disabled, ran my roster script and it STILL ran perfectly fine, yet as I said, in a blank char setting with only the roster script, the text flew by to quick for it to be caught.
I was under the impression that if a trigger is turned off it is by passed and not touched. Is this correct or is a trigger turned off still evaluated, and THEN it sees that it's turned off? Or is it the checking to see if it's turned off 1st that still slows it down?
I have i'd say about 90% of my triggers using the #T+/- (the 10% aren't off because i need SOME triggers to go off to turn the others on :-) |
|
|
 |
|
|