playerHelperobject | newbie.t[151]

The playerHelper is an object that starts a daemon at start of play. This daemon checks whether the player is making any progress at all, and also watches the ratio of commands the parser rejects to the number of turns. If this ratio becomes too high (as defined by the errorThreshold property) we offer the player a HELP command. If it becomes very low (as defined by the ceaseCheckingErrorLevel property) we cease checking (i.e. stop the daemon) on the grounds that the player doesn't appear to need the kind of help we want to offer. We first perform a check after firstCheckAfter turns to see if the player is making any progress, and then after each errorCheckInterval turns to see if the player is having difficulty entering valid commands.

The idea is to keep offering HELP to an inexperienced player who clearly needs it, even if the player declined to read any help text at the start of the game.

`playerHelper : InitObject`

Superclass Tree (in declaration order)

`playerHelper`
`InitObject`
`ModuleExecObject`
`object`

Summary of Properties

`ceaseCheckingErrorLevel errorCheckInterval errorCount errorDaemonID errorThreshold firstCheckAfter firstCheckMsg startLocation`

``

Inherited from `ModuleExecObject` :
`execAfterMe execBeforeMe hasInitialized_ isDoingExec_ isExecuted_`

Summary of Methods

`errorCheck execute firstCheck firstCheckCriterion offerHelp startErrorDaemon stopErrorDaemon`

``

Inherited from `ModuleExecObject` :
`_execute classExec`

Properties

`ceaseCheckingErrorLevel` | `newbie.t[204]`

The proportion of rejected commands to turns, expressed as a percentage, below which we stop checking for errors. The default is 5 (in other words if less than 5 per cent of the player's commands are being rejected, the player presumably knows what s/he's doing, so we don't need to keep checking)

`errorCheckInterval` | `newbie.t[188]`

The number of turns between each check on whether the player is entering too many erroneous commands.

`errorCount` | `newbie.t[317]`

For internal use only: the number of badly formed commands the player has entered.

`errorDaemonID` | `newbie.t[311]`

For internal use only: the ID of the currently running error check Daemon (if there is one)

`errorThreshold` | `newbie.t[195]`

The proportion of rejected commands to turns (i.e. accepted commands) that will trigger an offer of help. We express this number as a percentage.

`firstCheckAfter` | `newbie.t[174]`

The number of turns that must elapse before we test the firstCheckCriterion to see if the player appears to be stuck.

`firstCheckMsg` | `newbie.t[180]`

The message to display if the player seems to be stuck at the start of the game.

`startLocation` | `newbie.t[168]`

The location the playerCharacter starts out in at the beginning of the game. It may be useful to know this in the firstCheckCriterion method.

Methods

`errorCheck ( )` | `newbie.t[251]`

Watch for a high percentage of errors in user input

`execute ( )`OVERRIDDEN | `newbie.t[157]`

Set up the firstCheck() Fuse and note the player character's starting location.

`firstCheck ( )` | `newbie.t[225]`

Check whether the player appears to be making any progress at the start of the game. If not, display a message offering help and start the error checking daemon.

`firstCheckCriterion ( )` | `newbie.t[215]`

The criterion to apply to see whether the player is making any progress at the start of the game. This method should return true if the player seems to be stuck. By default we simply return nil as there's no way of knowing how to measure 'stuckness' for games in general, so specific games will need to override this method. A game involved exploration might set the condition to gLocation == startLocation (meaning the player character hasn't moved) for example.

`offerHelp ( )` | `newbie.t[296]`

The offerHelp() method asks whether the player has played this kind of game before and accepts a Y or N answer. if the answer is NO then it goes on to display a message suggesting sources of help.

This method can usefully be called at the end of the gameMain.showIntro() method, but it's up to game authors to incluse it there if they want it/

`startErrorDaemon ( )` | `newbie.t[248]`

We've just offered help, so we'll wait another errorCheckInterval turns before seeing whether to offer it again.

`stopErrorDaemon ( )` | `newbie.t[279]`

Stop the error check daemon from running

Adv3Lite Library Reference Manual
Generated on 01/03/2024 from adv3Lite version 1.6.2