3. NPC

3. The NPC Class

3.1 NPC Initialization

The NPC (Non-Player Character) is a class primarily used for story-line development. As the story progresses, the NPC's are able to deliver information as well as items to the player. NPC's cannot battle, but they can deliver important items that will make it possible to progress.

To create an NPC, only one argument is required: name

More parameters will be necessary in updated versions.

An NPC would be created like this:

villager = TARBSengine.NPC("Elton")
# An NPC with the name "Elton".

3.2 NPC.talkto

NPC.talkto(text, *name)

NPC.talkto is used to relay information and dialogue to the player. Only one of the parameters is required: text. If the name argument isn't satisfied, the name of the NPC will not be printed when outputting the dialogue. If the argument is satisfied, the name of the NPC is outputted with the dialogue.

Usage:

villager.talkto("How are you doing today?", True)
## Elton: How are you doing today?
villager.talkto("What are you doing here?")
## What are you doing here?

Last updated