Can you 'unachieve' an Achieved() task in Inform 6?

I’m using the TASKS_PROVIDED and NUMBER_TASKS constants as described in section 22 of the Inform Designer’s Manual, 4th edn. You have to use the Achieved(task_number) library routine to indicate that a task has been completed and score it.

Unfortunately, I find myself in a situation where the task can be reversed so that it is no longer achieved. So is there any way of ‘unachieving’ it?

This is for a port of an old mainframe game where the score was not indicated when you earned points and there was no status line. You had to either type SCORE or finish the game to find out your score and the score was calculated dynamically. I want the score to be shown as you go.

I don’t think there’s anything in the Standard Library, but reversing the Achieved() routine is straightforward:

[ Unachieved num;
    if (task_done->num == 1) {
        task_done->num = 0;
        score = score - TaskScore(num);
1 Like

Perfect. Thanks.

IIRC, Adventure’s treasures can be removed from the trophy case (and the score downgraded accordingly); don’t remember if I6 Adventure uses the acheviements, but a look at this code can help ?

Best regards from Italy,
dott. Piergiorgio.

1 Like