Keeping Score

From ADRIFT 5 Manual Wiki
Revision as of 07:36, 16 February 2013 by Saabie (Talk | contribs) (Created page with "In an interactive fiction game it is quite common to have a scoring system in order to give the player an idea of how much of the game has been completed, and how much remains. I...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

In an interactive fiction game it is quite common to have a scoring system in order to give the player an idea of how much of the game has been completed, and how much remains. If it is possible to complete the game without obtaining the maximum possible score, then this also gives an incentive for the player to play the game again to try to obtain the missing points.

The most common scoring system gives the player points when they perform an action that is important to continuing towards finishing the game successfully. For example, if they need to have a particular object with them in order to complete the game, we could give them points when they find it and pick it up. But we only want to give them points the first time that they do this, otherwise they could simply keep putting the object down and picking it up again until they reach the maximum score.

Fortunately ADRIFT provides us with some special variables that not only prevent the player from obtaining the same points more than once, they also automatically keep track of the total amount of points that can be obtained.

These variables are %Score% and %MaxScore%.

To give the player 5 points for picking up a particular object, we would create a specific task for that object which overrides the "Take Objects (Parent Task)" general task. To it you can add a set-variable action that sets the "Score" variable to the expression "%Score%+5". If you did this with any other variable then 5 would be added to the variable every time you pick that object up, but, because %Score% is a special variable that can only be updated once by a given task, %Score% will only have 5 added to it the first time you pick up the object.

Whenever ADRIFT see's that you have added a set variable %Score% to %Score%+Value action to a task, it automatically adds that value to the %MaxScore% variable. If you remove the action from the task then ADRIFT will subtract that value from %MaxScore%. Hence the %MaxScore% variable will always contain the maximum score that the player can obtain if they execute every task which adds to the %Score% variable.