|
raks Beginner
Joined: 30 Jan 2002 Posts: 24 Location: USA
|
Posted: Wed Jan 30, 2002 11:17 pm
when i skill moves |
okay i would like to make a trigger for the following and make it play a wav when i moves to the next level
ex.
create food (Poor) (more than half)
moves to
create food (Poor) (alot)
and so forth to almost all
then it would change to
create food (Fair) (Nothing)
and keep going on
this is everthing i need it to play the sound on just the stuff in the second set of ()
Nothing, close to nothing, Very little, some, almost half, half,
more than half, alot, very much and almost all |
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Wed Jan 30, 2002 11:59 pm |
I don't know where you see this level
increase "create food (Poor) (more than half)"
but here is an idea assuming that the main
level is 1 word:
#TRIGGER {create food ~(%w~) ~(({nothing|
close to nothing|very little|some|
almost half|half|more than half|alot|
very much|almost all})~) {
#IF ("%1" <> @V_Create_Food_Level_Last) {
#PLAY c:windowsmediachimes.wav
#VAR V_Create_Food_Level_Last "%1"
}
}
That should notice if the second ( ) contains
something that wasn't there before and play
the .wav file.
TonDiening
Uses 6.16 |
|
|
|
raks Beginner
Joined: 30 Jan 2002 Posts: 24 Location: USA
|
Posted: Thu Jan 31, 2002 12:13 am |
pff i don't understand that mess trying to give me a head ach
i just know create trigger
copy patter, past
the type what i want in the value |
|
|
|
Charbal GURU
Joined: 15 Jun 2001 Posts: 654 Location: USA
|
Posted: Thu Jan 31, 2002 12:24 am |
I think you are trying to play a sound when the skill gets to (nothing) in the next level up, right?
If so, a slight modification of the above could be used:
#TRIGGER {create food ~(%w~) ~(({nothing|close to nothing|
very little|some|almost half|half|
more than half|alot|very much|almost all})~) {
#IF ("%1" <> @V_Create_Food_Level_Last) {
#IF ("%1" = "nothing") {
#PLAY c:windowsmediachimes.wav
}
#VAR V_Create_Food_Level_Last "%1"
}
}
If the text in the first () is ever more than one word, replace %w with * in the trigger pattern.
The trigger pattern is the main part of the logic in this example. I'd recommend taking a look at http://www.zuggsoft.com/zmud/help6/Pattern_.htm to learn more about them if you want. The {} and () and %w all serve as filters to only catch and store information about certain incoming lines.
- Charbal |
|
|
|
raks Beginner
Joined: 30 Jan 2002 Posts: 24 Location: USA
|
Posted: Thu Jan 31, 2002 12:34 am |
well you are close, it's at
create food (Poor) (more than half) now
play sound when it moves to alot
and like i said i don't understand this stuff
#TRIGGER {create food ~(%w~) ~(({nothing|close to nothing|very little|some|almost half|half|more than half|alot|very much|almost all})~) { #IF ("%1" <> @V_Create_Food_Level_Last) { #IF ("%1" = "nothing") { #PLAY c:windowsmediachimes.wav } #VAR V_Create_Food_Level_Last "%1" } }
i don't understand how the triger is set up, what #IF means, and so on i am somewhat new to useing zmud |
|
|
|
Charbal GURU
Joined: 15 Jun 2001 Posts: 654 Location: USA
|
Posted: Thu Jan 31, 2002 12:55 am |
Ah, then TomDiening's should be perfect for you.
A basic breakdown of his:
#TRIGGER {create food ~(%w~) ~(({nothing|close to nothing|very little|some|almost half|half|more than half|alot|very much|almost all})~)}
This means to make a trigger with that big long pattern (in the outer {}s). The pattern is used to figure out if zMUD should "fire" this trigger. %w is a wildcard that can stand for any number of letters but not for anything else. {nothing|close to nothing|very little|some|almost half|half|more than half|alot|very much|almost all} means that ONE of these things have to here so the word nothing would match but albatross wouldn't. So, we can reduce it a bit:
Make a trigger to catch lines matching a pattern of "create food ~(a single word here~) ~((one of the possible settings here)~)"
Now, all that needs to be explained is the use of parentheses. () around something has a special meaning in zMUD. It saves whatever it is around to %1 up through %99 depending on how many you put in. So, if we want to actually check and see if a line has a ( or ) in it (and make it so zMUD doesn't try to do anything with it) we have to put a ~ in front of it... so ~((one of the possible settings here)~) in our pseudo-pattern means to put whatever setting we did end up with in %1 so we can look at it later. The pattern also tells zMUD not to worry about the outer ( and ) by using ~( and ~).
So, the pattern will match
create food (poor) (nothing)
and
create food (great) (very much)
but not
create food (very good) (nothing)
(very good has a space in it)
or
create food (very good) (test)
(test isn't in the list)
or
create food (very good) nothing
(there aren't any ()s around nothing)
Okay. Now, there is the command to deal with:
#IF ("%1" <> @V_Create_Food_Level_Last) {
#PLAY c:windowsmediachimes.wav
#VAR V_Create_Food_Level_Last "%1"
}
Basically, #IF means that if a certain something is true, then we will do something else.
("%1" <> @V_Create_Food_Level_Last) is only true if %1 (stored by the ()s up above) is NOT the same as whatever is stored in the variable V_Create_Food_Level_Last. If this is true (the variable isn't what we have) then something changed and we should play the sound:
#PLAY c:windowsmediachimes.wav
#VAR V_Create_Food_Level_Last "%1"
The first line plays the sound, the second sets the V_Create_Food_Level_Last to the current skill level (so we don't think that it is still at the old level and start playing the sound again and again and again...)
That's probably as exhaustive an overview as I can give. My advice would be to check out the help files. That link above and http://www.zuggsoft.com/zmud/help6/Intr0178.htm should give you a fair idea of how triggers work (both links point to parts of the online version of the help files, http://www.zuggsoft.com/zmud/help6/helpset.htm for access to all of it). For the individual commands, you can look them up either on the web or in the zMUD help file.
- Charbal |
|
|
|
raks Beginner
Joined: 30 Jan 2002 Posts: 24 Location: USA
|
Posted: Thu Jan 31, 2002 1:28 am |
okay it did not work
trigger pattern
create food ~(%W~) ~(({nothing|close to nothing|very little|some|almost half|half|more than half|alot|very much|almost all})~)}
Value:
#IF ("%1" <> @V_Create_Food_Level_Last) {#IF ("%1" <> @V_Create_Food_Level_Last) {
#PLAY d:GameszmudYarincreatefood.wav
#VAR V_Create_Food_Level_Last "%1"
} |
|
|
|
raks Beginner
Joined: 30 Jan 2002 Posts: 24 Location: USA
|
Posted: Thu Jan 31, 2002 1:30 am |
oops
Value:
#IF ("%1" <> @V_Create_Food_Level_Last) {
#PLAY d:GameszmudYarincreatefood.wav
#VAR V_Create_Food_Level_Last "%1"
} |
|
|
|
raks Beginner
Joined: 30 Jan 2002 Posts: 24 Location: USA
|
Posted: Thu Jan 31, 2002 2:14 am |
okay i got it to work somewhat with this line
pattern
create food(*)(*)(*)(({nothing|close to nothing|very little|some|almost half|half|more than half|alot|very much|almost all})~)
value:
#IF ("%1" <> @V_Create_Food_Level_Last) {
#PLAY d:GameszmudYarincreatefood.wav
#VAR V_Create_Food_Level_Last "%1"
}
it makes a var with only part of the line
(Somewhat good) (close to |
|
|
|
Charbal GURU
Joined: 15 Jun 2001 Posts: 654 Location: USA
|
Posted: Thu Jan 31, 2002 7:47 am |
quote:
okay it did not work
trigger pattern
create food ~(%W~) ~(({nothing|close to nothing|very little|some|almost half|half|more than half|alot|very much|almost all})~)}
Value:
#IF ("%1" <> @V_Create_Food_Level_Last) {#IF ("%1" <> @V_Create_Food_Level_Last) {
#PLAY d:GameszmudYarincreatefood.wav
#VAR V_Create_Food_Level_Last "%1"
}
Try:
Pattern:
create food%s~(%w~)%s~(({nothing|close to nothing|very little|some|almost half|half|more than half|alot|very much|almost all})~)
Value:
#IF ("%1" <> @V_Create_Food_Level_Last) {#PLAY "d:GameszmudYarincreatefood.wav";#VAR V_Create_Food_Level_Last "%1"}
There was an extraneous } in the pattern above. I also put in %s which will match any number of spaces (not having the right number in the pattern is a fairly common problem).
- Charbal |
|
|
|
raks Beginner
Joined: 30 Jan 2002 Posts: 24 Location: USA
|
Posted: Thu Jan 31, 2002 4:15 pm |
okay that works
but when the spell gets to
create food (Somewhat Good) (nothing)
create food (Not so Bad) (nothing)
create food (Almost Good) (nothing)
create food (Very Good) (nothing)
create food (Extremely Good) (nothing)
it will not work
(Horrible, Terrible, Awful, Bad, , Poor, Fair, Somewhat Good,
Almost Good, Good, Very Good, Extremely Good, Excellent, Awesome,
Dangerous, Lethal, Expert, Masterly, Superior, Almost Godly and Godly!) |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Thu Jan 31, 2002 6:46 pm |
As Tom said:quote: assuming that the main
level is 1 word
Since it's not, you'll need to change the %w to *.
LightBulb
All scripts untested unless otherwise noted |
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Thu Jan 31, 2002 10:22 pm |
* matching can get you in trouble now
and then so I try to avoid them if I can.
So my 2 more cents to this would be if you
know all the possibilities for the first (*)
levels then I'd put them in..
Charbal's trigger modified:
Pattern:
create food%s~({Horrible|Terrible|Awful|Bad|Poor|Fair|Somewhat Good|Almost Good|Good|Very Good|Extremely Good|Excellent|Awesome|Dangerous|Lethal|Expert|Masterly|Superior|Almost Godly|Godly~!|Somewhat Good|Not so Bad|other words here}~)%s~(({nothing|close to nothing|very little|some|almost half|half|more than half|alot|very much|almost all})~)
Value:
#IF ("%1" <> @V_Create_Food_Level_Last) {#PLAY "d:GameszmudYarincreatefood.wav";#VAR V_Create_Food_Level_Last "%1"}
TonDiening
Uses 6.16 |
|
|
|
Raksasas Novice
Joined: 09 Aug 2001 Posts: 39 Location: USA
|
Posted: Sun Feb 22, 2004 5:37 am |
First off Raks = me
Okay for some reason I am not getting this to work in 7.01
If there was a problem in the line somewhere I sure don't remember what i did to get it to work. Been about a year since i last played a mud
btw last time i used this i change it to make the background a red color with the froground white instead of playing a wave file |
|
|
|
Raksasas Novice
Joined: 09 Aug 2001 Posts: 39 Location: USA
|
Posted: Sun Feb 22, 2004 5:45 am |
Never mind. I figured it out...i think
|
|
|
|
Raksasas Novice
Joined: 09 Aug 2001 Posts: 39 Location: USA
|
Posted: Sun Feb 22, 2004 6:06 am |
okay i found my problem
as my skills progress they get to :
summon creature (Extremely good)(almost all)
since there is no space between, (Extremely good)(almost all), it is not picking up with one TonDiening came up with. any idea on how to fix it?
it's the only one that will do thise |
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Sun Feb 22, 2004 7:49 am |
This will do it Change the %s between the two groups of words to ?
It will match Space or no Space
create food%s~({Horrible|Terrible|Awful|Bad|Poor|Fair|Somewhat Good|Almost Good|Good|Very Good|Extremely Good|Excellent|Awesome|Dangerous|Lethal|Expert|Masterly|Superior|Almost Godly|Godly~!|Somewhat Good|Not so Bad|other words here}~)?~(({nothing|close to nothing|very little|some|almost half|half|more than half|alot|very much|almost all})~) |
|
|
|
Raksasas Novice
Joined: 09 Aug 2001 Posts: 39 Location: USA
|
Posted: Sun Feb 22, 2004 4:28 pm |
Does not work with ?. I empted the variable, tried it, and nothing.
|
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sun Feb 22, 2004 9:14 pm |
Just make a second trigger without the space.
|
|
|
|
|
|