if commands...
MatCauthon137
02 Jun 2011, 23:14Ok, so maybe I am going about this the wrong way. I want it so that if you don't have the map, then it asks you if you want a map, and if you do, then it give you the map.
What I got was if you get the map in this way, then talk to him again while holding the map, the game ignores the first part of the if command and asks you if you want a map anyway. Then if you say "yes" it does nothing since you already hold the map. I don't want it to even ask you if you already have the map. I have attatched my code here. Help?
sorry had to edit cuz i forgot to include the code for the map itself
What I got was if you get the map in this way, then talk to him again while holding the map, the game ignores the first part of the if command and asks you if you want a map anyway. Then if you say "yes" it does nothing since you already hold the map. I don't want it to even ask you if you already have the map. I have attatched my code here. Help?
define object <table3>
alias <table>
look <This is the Royal Map Table of the Grand Mystic Map-Makers to the Elders of the Magic of Muhkenzee. This living table has been to all corners of the realm, and when he retired from his traveling, he came to live out the rest of his life in this mansion. Elders from all over the realm come here to talk to the table to find out about the places they are going. To get the lay of the land, so to speak.>
take msg <"I would love to come with you, but alas, my legs are tired. Perhaps you would benefit from one of my maps instead?">
speak {
if not got <map2> and ask <Do you want me to draw you a map of the house?> then {
show <map2>
give <map2>
exec <look at smap>
msg <"Feel free to take this magic smap with you as you journey. Come back later if you need another magic smap.> }
}
prefix <a>
displaytype <Character>
article <him>
gender <he>
use <wand4> msg <"Oh, thank you. I feel so much better now. That was very refreshing.">
surface
add msg <"Could you please not set that on me. What do I look like, a table?>
remove
end define
define object <map2>
alias <Magic Smap>
alt <map>
look picture <map house.jpg>
take
speak <"You live here, and you still can't find your way? Must be a big house.">
displaytype <Object>
detail <house>
article <it>
gender <it>
hidden
drop everywhere <Ok, but you may get lost.>
end define
sorry had to edit cuz i forgot to include the code for the map itself
Alex
03 Jun 2011, 09:33Try splitting it up into two "if"s:
speak {
if not got <map2> then {
if ask <Do you want me to draw you a map of the house?> then {
show <map2>
give <map2>
exec <look at smap>
msg <"Feel free to take this magic smap with you as you journey. Come back later if you need another magic smap.>
}
}
}
MatCauthon137
03 Jun 2011, 14:04Thanx Alex. I will try that. I won't have a chance to test it until I get home tonight, but from what I can see that should work just fine.
MatCauthon137
04 Jun 2011, 15:50Hey, that worked. Thanx