mob
melp
Mission_Giver
icon = 'NPC.dmi'
icon_state = "mission giver"
npc = 1
hp = 99999999999999999999999999999999999999999999999999999999999999999999999
verb
Talk()
set src in oview(1)
set category = "Commands"
for(var/obj/O in usr.contents)
if(O.name=="Puppet")
alert("Yes!! You got the puppet i was looking for...Thanks, here is 300 Yen and 1 D Rank Mission Point.")
usr.yen+=300
usr.D+=1
usr.ondmission = 0
usr.kanktalk = 0
if(usr.ondmission==1)
alert("Im sorry, Finish the mission your on already...","Mission Giver")
return
switch(input("What kind of mission would you like?.","Mission Giver") in list ("S","A","B","C","D"))
if("S")
alert("There are none available right now.")
if("A")
alert("There are none available right now.")
if("B")
alert("There are none available right now.")
if("C")
alert("There are none available right now.")
if("D")
if(usr.rank=="Genin"||"Chuunin"||"Jounin")
switch(input("Are you sure you would like to do this mission?") in list ("Yes","No"))
if("Yes")
alert("Ok, I want you to go talk to a mysterious man in in Sand Village, He is said to use puppets, Get me one.")
ondmission=1
if("No")
alert("Come back when your ready to do a mission")
else
alert("Im sorry you must be at least Genin to do the missions")
Problem description:For some reason it doesnt read the O.name...why? because i have it in my inventory and i still cant get the message to come up it says Im sorry, Finish the mission your on...thats odd
Your problem is that everything after your first if() statement(and its contents) should be unindented by one. Basically, your saying:
"For every object in my contents, if it is named "Puppet" do some stuff, but as long as I am ondmission, send me a message. Then do the switch() proc."
Now if you check if you are ondmission for every object in your contents, imagine if your puppet is the 3rd item. That means that it'll have looped through twice without setting ondmission to 0, and you'll receive that "Im sorry" message.
Now, I don't know why I bother. You never seem to listen. I know for a fact that I have already told you not to check variables like:
if(variable == 1)
if(variable == 0)
What you want to use is:
Another thing I'm pretty sure I've told you is that you can't simplify your if() statements that way.
"If my rank is 'Genin', or if 'Chuunin' or 'Jounin' are nonzero values(which, being text, they are nonzero), execute this code." And since your text is a constant nonzero value, the if() statement will always execute. You have to fully say what you want your if() statement to do:
As you can see, for each separate tested statement, you must write out the full statement, no shortcuts.
Please listen to all of what I've said, it's getting annoying to have to repeat myself.
Hiead