Easygoing Eyebeast Morgan Posted April 28, 2004 Share Posted April 28, 2004 Are timers in any way possible in BoA? The most obvious way, as I saw it, was to do the following - inc_flag(0,0,1); if(get_flag(0,0) == 5) { code chunk } break; Unfortunately, when I put this in the START_STATE in a town script, it tells me I have an improper command. I figured this was because the game thought I was creating an eternal loop (though I wasn't - the code I'm using is a bit more complex then that), but I'm not entirely sure what to do about it. I also tried it with variables. Any ideas for making this work, or an alternative timer? Scrap that. I found me a workaround - beginstate START_STATE; if(get_flag(180,1) == 0) { timer = get_current_tick(); set_flag(180,1,1); } if((get_current_tick()) == (timer + 6)) { add_dialog_str(0,"This is working",0); add_dialog_choice(0,"Done"); run_dialog(0); } break; Where timer is (obviously) a variable. Link to comment Share on other sites More sharing options...
Garrulous Glaahk spyderbytes Posted April 28, 2004 Share Posted April 28, 2004 If I'm understanding you correctly, and you're wanting an event that happens every nth tick, an alternative would be: if ((get_current_tick() % n) == 0) { // do stuff here } (where n is the number of ticks between occurences). Of course, that doesn't allow you to start on a particular tick and then every nth one after that... it just hits every nth one starting with the next multiple of n. Link to comment Share on other sites More sharing options...
Easygoing Eyebeast Morgan Posted April 28, 2004 Author Share Posted April 28, 2004 No - it's linking into a creature script, where the monster teleports away for five turns, then returns. Your's would be better alternatively, though. Link to comment Share on other sites More sharing options...
Recommended Posts