Garrulous Glaahk Abu Dhabi Posted July 2, 2004 Share Posted July 2, 2004 My code: Code: beginstate 18; reset_dialog(); // Dialog box here add_dialog_str(0,"Description.",0); add_dialog_str(1,"Knock?",0); add_dialog_choice(0,"Knock."); add_dialog_choice(1,"Leave."); run_dialog(1); if (choice == 1) // Conditions{ begin_shop_mode("Name","Description.",4,3,-1); // Shop No 4, } //moderate buy, no sell if (choice == 2){ end();} break; // End Now, why doesn't it work like it's supposed to? There is no response from the game, no matter if I choose option one or two. Just as if I put end(); in both choices. It's clearly supposed to be a shop. Anyone has a clue? Link to comment Share on other sites More sharing options...
Garrulous Glaahk Crunchy Frog Posted July 2, 2004 Share Posted July 2, 2004 You haven't actually set the variable "choice" to anything. You have to explicitly assign it to run_dialog(), like this: Code: choice=run_dialog(1) Link to comment Share on other sites More sharing options...
Garrulous Glaahk UA Posted July 3, 2004 Share Posted July 3, 2004 Also, a question. Why are you putting the { bracket on a new line? You don't need to and it looks weird. Link to comment Share on other sites More sharing options...
Garrulous Glaahk Abu Dhabi Posted July 10, 2004 Author Share Posted July 10, 2004 Quote: Originally written by Shining Lightbulb:Also, a question. Why are you putting the { bracket on a new line? You don't need to and it looks weird. It may look weird to you, but I have issues about condition statements in programming -- if I don't put them there I end up confused as to where the statement ends and where the next begins. I guess it's a personal thing. Link to comment Share on other sites More sharing options...
Recommended Posts