Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Canities_Crimthann
Newbie


Joined: 22 Feb 2005
Posts: 3

PostPosted: 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 Sad
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
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: 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
Reply with quote
mr_kent
Enchanter


Joined: 10 Oct 2000
Posts: 698

PostPosted: 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.
Reply with quote
Canities_Crimthann
Newbie


Joined: 22 Feb 2005
Posts: 3

PostPosted: 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.
Reply with quote
Canities_Crimthann
Newbie


Joined: 22 Feb 2005
Posts: 3

PostPosted: 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
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net