Well-Actually War Trall Ishad Nha Posted June 18, 2009 Share Posted June 18, 2009 Now that BoE is open source we have had the opportunity to create proper debug functions for scenario designers. In BoA there is a debug call but it does not do everything. Here is one approach to giving an item, this approach does not require you to break off the game, go to the Character Editor, save and then reload. beginstate 26; get_text_response("Choose a letter: "); check_text_response_match("I"); if (got_text_match()) set_state_continue(136); break; beginstate 136; i = 0; while (i < 3) { get_text_response("Give Item, what digit: 0 - 9?"); check_text_response_match("0"); if (got_text_match()){ set_flag(200,i,0); } check_text_response_match("1"); if (got_text_match()){ set_flag(200,i,1); } check_text_response_match("2"); if (got_text_match()){ set_flag(200,i,2); } check_text_response_match("3"); if (got_text_match()){ set_flag(200,i,3); } check_text_response_match("4"); if (got_text_match()){ set_flag(200,i,4); } check_text_response_match("5"); if (got_text_match()){ set_flag(200,i,5); } check_text_response_match("6"); if (got_text_match()){ set_flag(200,i,6); } check_text_response_match("7"); if (got_text_match()){ set_flag(200,i,7); } check_text_response_match("8"); if (got_text_match()){ set_flag(200,i,8); } check_text_response_match("9"); if (got_text_match()){ set_flag(200,i,9); } i = i + 1; } a = 100 * get_flag(200,0) + 10 * get_flag(200,1) + get_flag(200,2); reward_give(a); reward_give(a); break; This approach can be customized, for example if you want to choose which outdoor section the party will visit next. You would have a change outdoor location added to all exit specials of a town, the x and y values would be SDFs, then in the scenario script the while clause would set the two flags concerned. It would take effect when party exits the town. The party can move between towns at will via this method. Edit: Insert this into your Scenario script. You can use any state number that you like. Quote Link to comment Share on other sites More sharing options...
Understated Ur-Drakon Celtic Minstrel Posted June 18, 2009 Share Posted June 18, 2009 Uh... if you're looking for a numeric response, isn't there a different function that does all that for you? This code seems rather inefficient. Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Niemand Posted June 18, 2009 Share Posted June 18, 2009 Actually, no; in his infinite wisdom Jeff decided that we didn't need to use atoi, so large trees of exact string checks are the only way to go. Quote Link to comment Share on other sites More sharing options...
Understated Ur-Drakon Celtic Minstrel Posted June 18, 2009 Share Posted June 18, 2009 Oh, wait, I didn't notice this was AvernumScript. Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Ishad Nha Posted June 19, 2009 Author Share Posted June 19, 2009 I added a note to the effect that it is scenario script that we are discussing. See HLPM for how convoluted attempts to get around these problems can be. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.