It sounds like a very simple problem. When the player has the full score, how do I tell the game to play the ending scenes ? And where do I put the code in the global script ?
I think you want to use the GOT_SCORE parameter of the on_event function. By default, I don't think on_event exists in the script, so you'll have to create it if you haven't already. Something like:
function on_event (int event, int data) {
Ã, if (event == GOT_SCORE) { // Called whenever score changes
Ã, Ã, if (game.score == game.total_score ) { // fairly self-explainatory
Display ("Congratulations, you've won.");
Ã, Ã, Ã, NewRoom (300);
// Or whatever you want to happen
Ã, Ã, }
Ã, }
}
It can go anywhere in the global script, provided it's not inside another function.
Thanks ! Problem solved !
Updated BFAQ: http://bfaq.terran-x.com/#graphics13
Credit given to Ashen for the quoted code as well. :)