|
ralgith Sorcerer
Joined: 13 Jan 2006 Posts: 715
|
Posted: Thu Jun 26, 2008 3:08 am
Trigger In a Disabled Class firing when Class is enabled AFTER the Pattern... |
Ok, I'll get a screenshot of this ASAP, but basically the trigger that is in the emerald, green, and blue subclasses that is the same (The No-one message) is firing for green, which then enables blue and disables green, but then the one in blue fires as well even though the pattern has not been received again. Can anyone shed some light on this?
NOTE: This is a work in progress and is kinda messy atm, so don't give me improvement talk... just tell me why its firing even though not enabled till after the pattern is received. :)
Code: |
#CLASS {Scripts}
#ALIAS script {
#if (%1 = "off") {
#echo shutting down scripting sessions!
rst_scripts
}
#if (%1 = "adam") {
#echo Initiating Adamantite Mines Script!
rst_scripts
#t+ adamscript
goto adamantite
}
#if (%1 = "gold") {
#echo Initiating Gold Mines Script!
rst_scripts
#t+ goldscript
#t- gold_where_check
#CLASS {Scripts}
#VAR gold gold
#CLASS 0
goto @gold
}
#if (%1 = "diam") {
#echo Initiating Diamond Mines Script!
rst_scripts
#t+ diamscript
goto diamond
}
#if (%1 = "emer") {
#echo Initiating Emerald Mines Script!
rst_scripts
#t+ emeraldscript
#t+ emerald
#t- blue
#t- green
#CLASS {Scripts}
#VAR emer_mob Emerald
#VAR green_numb 0
#CLASS 0
goto @emer_mob
}
}
#ALIAS rst_scripts {
#t- adamscript
#t- goldscript
#t- diamscript
#t- emeraldscript
}
#ALIAS off {
#echo Shutting down scripting sessions!
#t- adamscript
#t- goldscript
#t- diamscript
#t- emeraldscript
#t- autotrail
}
#VAR scripttank {Noone}
#VAR gold {gold}
#VAR emer_mob {blue}
#VAR green_numb {0}
#CLASS 0
#CLASS {Scripts|adamscript} {disable}
#TRIGGER {You receive your share of experience -- (%d) points.} {goto adamantite}
#TRIGGER {You're already in the same room!!} {
|@scripttank|upp adamantite
|@scripttank|junk all.corpse
}
#TRIGGER {No-one around by that name.} {
#ECHO {Adamantite Mines Script Completed}
off
}
#CLASS 0
#CLASS {Scripts|goldscript} {disable}
#TRIGGER {You receive your share of experience -- (%d) points.} {goto @gold}
#TRIGGER {You're already in the same room!!} {
|@scripttank|upp gold
|@scripttank|junk all.corpse
}
#TRIGGER {You don't have a corpse.} {get all all.corpse}
#TRIGGER {No-one around by that name.} {
#ECHO {Gold Mines Script Completed}
off
}
#TRIGGER {{You can't sense a trail to her from here.|You can't sense a trail to him from here.|You can't sense a trail to it from here.|You sense no trail.}} {
#T+ gold_where_check
where gold
}
#CLASS 0
#CLASS {Scripts|goldscript|gold_where_check}
#TRIGGER {*gold *~- Gold Mines} {
#CLASS {Scripts}
#ADD gold_numb 1
#VAR gold %concat( @gold_numb, ".gold")
#CLASS 0
goto @gold
#T- gold_where_check
}
#CLASS 0
#CLASS {Scripts|diamscript} {disable}
#TRIGGER {You receive your share of experience -- (%d) points.} {goto diamond}
#TRIGGER {You're already in the same room!!} {
|@scripttank|upp diamond
|@scripttank|junk all.corpse
}
#TRIGGER {No-one around by that name.} {
#ECHO {Diamond Mines Script Completed}
off
}
#CLASS 0
#CLASS {Scripts|emeraldscript} {disable}
#TRIGGER {You receive your share of experience -- (%d) points.} {goto @emer_mob}
#CLASS 0
#CLASS {Scripts|emeraldscript|Emerald}
#TRIGGER {No-one around by that name.} {
#T+ green
#CLASS {Scripts}
#VAR emer_mob green
#CLASS 0
#T- emerald
goto @emer_mob
}
#TRIGGER {You're already in the same room!!} {
|@scripttank|upp Emerald
|@scripttank|junk all.corpse
}
#CLASS 0
#CLASS {Scripts|emeraldscript|Blue}
#TRIGGER {You're already in the same room!!} {
|@scripttank|upp Blue
|@scripttank|junk all.corpse
}
#TRIGGER {No-one around by that name.} {
#ECHO {Emerald Mines Script Completed}
#t- blue
off
}
#CLASS 0
#CLASS {Scripts|emeraldscript|Green}
#TRIGGER {You're already in the same room!!} {
|@scripttank|upp Green
|@scripttank|junk all.corpse
}
#TRIGGER {{You can't sense a trail to her from here.|You can't sense a trail to him from here.|You can't sense a trail to it from here.|You sense no trail.}} {
#T+ where_check
where green
}
#CLASS 0
#CLASS {Scripts|emeraldscript|Green|where_check}
#TRIGGER {*green troll warrior%s~-*} {
#CLASS {Scripts}
#ADD green_numb 1
#VAR emer_mob %concat( @green_numb, ".green")
#CLASS 0
goto @emer_mob
#T- where_check
}
#TRIGGER {No-one around by that name.} {
#CLASS {Scripts}
#VAR emer_mob blue
#CLASS 0
#t- where_check
#T- green
#T+ blue
goto @emer_mob
}
#CLASS 0 |
|
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Thu Jun 26, 2008 3:30 am |
Basically zMud has a limited concept of priority. zMud goes through all your triggers, in order, and test all those that are enabled. You need to move the trigger above the other trigger that enables it. The way to do that is to turn on the show all classes in the settings editor, then find the one you want to be tested earlier and drag it higher or click the Move Up button.
|
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
ralgith Sorcerer
Joined: 13 Jan 2006 Posts: 715
|
Posted: Thu Jun 26, 2008 3:41 am |
Well. That's so nice...
But that still doesn't explain why it is firing even though it was disabled when the text was received from the MUD. If it wasn't enabled at that time, then it shouldn't fire regardless. Unless I'm misunderstanding what you're getting at. I'll try changing their order and see what happens. |
|
_________________ CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate |
|
|
|
ralgith Sorcerer
Joined: 13 Jan 2006 Posts: 715
|
Posted: Thu Jun 26, 2008 3:49 am |
Wait... that actually makes sense if zMUD is parsing classes from the bottom up...
|
|
_________________ CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate |
|
|
|
ralgith Sorcerer
Joined: 13 Jan 2006 Posts: 715
|
Posted: Thu Jun 26, 2008 3:54 am |
Ok, moving green above blue in the class list did absolutely nothing to fix this. I've tried multiple orders and nothing fixes it. Meh, getting irritated.
Here is my MUD output:
Code: |
7383hp 2387m 1528mv> You're already in the same room!!
upp Green
junk all.corpse
7383hp 2387m 1528mv> Your uppercut at Feriankian green troll warrior's face splits his head open!
You receive your share of experience -- 19510 points.
trail green
You get a large heap of gold coins from the corpse of Feriankian green troll warrior.
There were 10000 coins.
7383hp 2387m 1528mv> You don't seem to have any corpses.
7383hp 2387m 1528mv> You can't sense a trail to it from here.
where green
7383hp 2387m 1528mv> No-one around by that name.
trail blue
(ECHO)Emerald Mines Script Completed
(ECHO)Shutting down scripting sessions!
7383hp 2387m 1528mv> You're already in the same room!!
|
As you can see, even though the No-one message comes, enables blue and disables green... as soon as trail blue is entered it shuts the script down. Which isn't supposed to happen until it receives another No-one message. |
|
_________________ CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Thu Jun 26, 2008 11:05 am |
Moving the blue triggers up should fix your problem, but you can also fix it by shifting the timing
Code: |
#CLASS {Scripts|emeraldscript|Green|where_check}
#TRIGGER {No-one around by that name.} {
#CLASS {Scripts}
#VAR emer_mob blue
#CLASS 0
#t- where_check
#T- green
#ALARM {+.5} {#T+ blue}
goto @emer_mob
}
#CLASS 0 |
This like this are why CMud added clearer priorities, and the stop further processing option.
Another solution is to move the all the No one around triggers to your top level and use the %class funtion to determine which set of commands should be sent. Yet another suggestion would be to put them as a second state to the trail triggers, and then use the #STATE command to reset them when you find a target. |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
ralgith Sorcerer
Joined: 13 Jan 2006 Posts: 715
|
Posted: Thu Jun 26, 2008 4:11 pm |
I'll try with the alarm, but moving the order didn't help. It was firing no matter what order they were in.
|
|
_________________ CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate |
|
|
|
ralgith Sorcerer
Joined: 13 Jan 2006 Posts: 715
|
Posted: Thu Jun 26, 2008 4:18 pm |
Ok, the alarm worked. Heck, I'm only using this because the area is a maze with a lot of random room exits and stuff which makes it impossible to walk around normal without a REALLY good memory that room 5 exits east to room 80... or by using the mapper. But I don't use the mapper ;)
Sadly, other than a few really bad corners, I am one of maybe 3 people that DOES have this zone memorized... |
|
|
|
|
|