|
Canities_Crimthann Newbie
Joined: 22 Feb 2005 Posts: 3
|
Posted: Tue Feb 22, 2005 9:12 pm
RE: Some Code i need help with |
I am currently trying to work out how to get an if statement to work...
It is part of a trigger that uses:
^&person looks at you.
peek @person
#IF (%w is a Halfling) {emo look's at @person}{
emo look's up at @person.
emo fall's flat on his back from leaning to far.
}
However the if statement i have made doesn't seem to work
What you see above is what i can make out in the help file, which doesnt really explain much...
What i need it to do is to get wether the chararacter im peeking at is halfling or not and then make the appropriate responce.
eg. if they are a halfling i look at them, if not i look at them and fall over....
I am using Zmud Ver 7.05
Can amyone help??
Regards Canities |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Tue Feb 22, 2005 11:59 pm |
Quote: |
^&person looks at you.
|
#if ("%1" = "a Halfling") {emo look's up at @person.} {emo fall's flat on his back from leaning to far.}
Unless you have a bunch of a Halfling's running around in your MUD, however, I suspect you are going to be falling down a lot. |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
mr_kent Enchanter
Joined: 10 Oct 2000 Posts: 698
|
Posted: Wed Feb 23, 2005 6:56 am |
#TR {^&person looks at you.} {#T+ return_look;peek @person}
#TR "return_look" {%w is a (%w)} {#ALA +5 {#T- return_look};#If ("%1" = "Halfling") {emo looks at @person.} {emo looks up at @person, but leans too far and falls flat on his back!}}
This could be rewritten using a #COND, but I dislike having to look up the syntax on the web. Maybe someone else will do this if this is indeed what you'd like. |
|
|
|
Canities_Crimthann Newbie
Joined: 22 Feb 2005 Posts: 3
|
Posted: Wed Feb 23, 2005 6:29 pm |
mr_kent wrote: |
#TR {^&person looks at you.} {#T+ return_look;peek @person}
#TR "return_look" {%w is a (%w)} {#ALA +5 {#T- return_look};#If ("%1" = "Halfling") {emo looks at @person.} {emo looks up at @person, but leans too far and falls flat on his back!}}
This could be rewritten using a #COND, but I dislike having to look up the syntax on the web. Maybe someone else will do this if this is indeed what you'd like. |
Ok this kind of works.
The only problem is it returns the chars name as %1
I dont know if this works yet but i modified the code slightly to:
#TR {^&person looks at you.} {
#T+ return_look
peek @person
}
#TR "return_look" {@person is a %w} {
#ALA +5 {#T- return_look}
#If ("%2" = "Halfling") {emo look's at @person.} {emo looks up at @person, but lean's too far and fall's flat on his back!}
(i have tried this with: #If ("%1" = "Halfling") but again it was returning %1 as the name of the char.)
I'll let ya know what happens with the amended version. |
|
|
|
Canities_Crimthann Newbie
Joined: 22 Feb 2005 Posts: 3
|
Posted: Wed Feb 23, 2005 8:00 pm |
Ok, i got it sused
so that it works properly i changed ot to:
#TR {^&person looks at you.} {
#T+ return_look
peek @person
}
#TR "return_look" {@person is a &race %w} {
#ALA +5 {#T- return_look}
#If (@race = "Halfling") {Emo looks at @person} {emo looks up at @person, but lean's too far and fall's flat on his back!}
}
and it seems to work, it also allows me to change the race paramiter to what i want
Thanks for the help All
Canities |
|
|
|
|
|