ID:143303
 

mob/verb/pop_quiz()

var/choice = input(usr,"2 times 2?","Question") in list("2","4","8","I don't know.")

if(choice == "4")
usr << "Correct."
usr:MakeGold()
usr:GiveExp()
else if(choice == "I don't know.")
usr << "Study study study."
else
usr << "Incorrect." //above works fine

//below doesn't at all



mob/verb/pop_quiz2()
Question1()


mob/proc/Question1()
usr << "askjfh"
var/choice = input(usr,"2 times 2?","Question") in list("2","4","8","I don't know.")

if(choice == "4")
usr << "Correct."
usr:MakeGold()
usr:GiveExp()
else if(choice == "I don't know.")
usr << "Study study study."
else
usr << "Incorrect."


why doesn't this code work?, if i just put the usr << "x" it works fine but i try to insert the series of code that just comes straight out of verb section above and it won't work. shouldn't the same code that works in a verb work in a proc?
In response to Cheetoz
figured out a way to make it work

mob/proc/key1()

var/choice = input(usr,"2 times 2?","Question") in list("2","4","8","I don't know.")

if(choice == "4")
usr << "Correct."
usr:MakeGold()
usr:GiveExp()
else if(choice == "I don't know.")
usr << "Study study study."
else
usr << "Incorrect."

mob/proc/key2()

var/choice = input(usr,"2 times 3?","Question") in list("2","4","6","I don't know.")

if(choice == "6")
usr << "Correct."
usr:MakeGold()
usr:GiveExp()
else if(choice == "I don't know.")
usr << "Study study study."
else
usr << "Incorrect."



mob/verb/pop_quiz()
Question()


mob/proc/Question()
var/number = rand(1,10)
usr << "[number]"
if(number == 1)
usr:key1()
if(number == 2)
usr:key2()
if(number == 3)
usr:Question()
if(number == 4)
usr:Question()
if(number == 5)
usr:Question()
if(number == 6)
usr:Question()
if(number == 7)
usr:Question()
if(number == 8)
usr:Question()
if(number == 9)
usr:Question()