|
saplingg Novice
Joined: 06 Oct 2005 Posts: 31
|
Posted: Fri Nov 04, 2005 12:17 pm
Colouring Trigger |
I'm trying to make a trigger that colours some lines. In the MUD I play, combat messages from you are in yellow, from a person in your group are in red, and against you or your group are also in red.
I am trying to set up a trigger that colours attacks from a friendly against anyone else in blue.
This is the code I am trying to use.
Code: |
#TRIGGER {%1 sneaks past} {#IF (%1 = Gob) {#CO cornflowerblue}}
#TRIGGER {%1 forces past} {#IF (%1 = Gob) {#CO cornflowerblue}}
#TRIGGER {%1 feints to the left and} {#IF (%1 = Gob) {#CO cornflowerblue}}
#TRIGGER {%1 rushes forward and} {#IF (%1 = Gob) {#CO cornflowerblue}} |
However, it does not work. When another person (other than "Gob") attacks either me or a third party, it occasionally also colours that blue.
For example,
A snake-demon with green scales feints to the left and nicks your left leg with her teeth!
was coloured blue in this case.
Could anyone help to rewrite or fix up my trigger? Thank you.
Additionally, let's say I wanted the colouring trigger to work for several people, and so I create a variable @friends which contains a string of names. Would a code like
Code: |
#TRIGGER {%1 sneaks past} {#IF (%1 = @friends) {#CO cornflowerblue}}
|
work?
Thanks! |
|
|
|
TerrellKl Novice
Joined: 30 Aug 2005 Posts: 49
|
Posted: Fri Nov 04, 2005 1:26 pm |
My only guess would be that this
#TRIGGER {%1 feints to the left and} {#IF (%1 = Gob) {#CO cornflowerblue}}
Should be this
#TRIGGER {%1 feints to the left and} {#IF (%1="Gob") {#CO cornflowerblue}}
I never used %1 as a variable before.. But in the case you have you probably should use * instead
soo..
Code: |
#TRIGGER {* sneaks past} {#IF (%1="Gob") {#CO cornflowerblue}}
#TRIGGER {* forces past} {#IF (%1="Gob") {#CO cornflowerblue}}
#TRIGGER {* feints to the left and} {#IF (%1="Gob") {#CO cornflowerblue}}
#TRIGGER {* rushes forward and} {#IF (%1="Gob") {#CO cornflowerblue}} |
As for the second trigger
#TRIGGER {%1 sneaks past} {#IF (%1 = @friends) {#CO cornflowerblue}}
I would use
Code: |
#TRIGGER {* sneaks past} {#IF (%ismember(@friends)) {#CO cornflowerblue}} |
I didn't test any of the triggers so they may have mistakes..
I might be a noob and Just screwed you up more.. buuut I can try |
|
|
|
darkspot Apprentice
Joined: 29 Jul 2002 Posts: 105
|
Posted: Fri Nov 04, 2005 4:07 pm |
Code: |
#var friends {Gob}
#var fightList {sneaks past|forces past|feints to the left and|rushes forward and}
#TRIGGER {(*) {@fightlist}} {#IF (%ismember(%1, @friends)) {#CO cornflowerblue}}
|
just A putting bracers around *, B making sure you had the %1 in ismember, C, adding my own personal obsession with using lists to get rid of multiple similair triggers :) |
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Fri Nov 04, 2005 8:58 pm |
Also the %1 part should be "%1" you should always quote your strings
|
|
|
|
saplingg Novice
Joined: 06 Oct 2005 Posts: 31
|
Posted: Sun Nov 06, 2005 2:40 pm |
Darkspot, that trigger doesn't work for me..
Should it be
#IF (%ismember(%1, @friends) > 0) or something like that? |
|
|
|
|
|