evennia.contrib.tutorials.talking_npc.talking_npc

Evennia Talkative NPC

Contribution - Griatch 2011, grungies1138, 2016

This is a static NPC object capable of holding a simple menu-driven conversation. It’s just meant as an example.

Installation:

Create the NPC by creating an object of typeclass contrib.tutorials.talking_npc.TalkingNPC, For example:

create/drop John : contrib.tutorials.talking_npc.TalkingNPC

Use talk in the same room as the NPC to start a conversation.

If there are many talkative npcs in the same room you will get to choose which one’s talk command to call (Evennia handles this automatically). This use of EvMenu is very simplistic; See EvMenu for a lot more complex possibilities.

evennia.contrib.tutorials.talking_npc.talking_npc.menu_start_node(caller)[source]
evennia.contrib.tutorials.talking_npc.talking_npc.info1(caller)[source]
evennia.contrib.tutorials.talking_npc.talking_npc.info2(caller)[source]
evennia.contrib.tutorials.talking_npc.talking_npc.info3(caller)[source]
evennia.contrib.tutorials.talking_npc.talking_npc.END(caller)[source]
class evennia.contrib.tutorials.talking_npc.talking_npc.CmdTalk(**kwargs)[source]

Bases: evennia.commands.default.muxcommand.MuxCommand

Talks to an npc

Usage:

talk

This command is only available if a talkative non-player-character (NPC) is actually present. It will strike up a conversation with that NPC and give you options on what to talk about.

key = 'talk'
locks = 'cmd:all()'
help_category = 'general'
func()[source]

Implements the command.

aliases = []
lock_storage = 'cmd:all()'
search_index_entry = {'aliases': '', 'category': 'general', 'key': 'talk', 'no_prefix': ' ', 'tags': '', 'text': '\n Talks to an npc\n\n Usage:\n talk\n\n This command is only available if a talkative non-player-character\n (NPC) is actually present. It will strike up a conversation with\n that NPC and give you options on what to talk about.\n '}
class evennia.contrib.tutorials.talking_npc.talking_npc.TalkingCmdSet(cmdsetobj=None, key=None)[source]

Bases: evennia.commands.cmdset.CmdSet

Stores the talk command.

key = 'talkingcmdset'
at_cmdset_creation()[source]

populates the cmdset

path = 'evennia.contrib.tutorials.talking_npc.talking_npc.TalkingCmdSet'
class evennia.contrib.tutorials.talking_npc.talking_npc.TalkingNPC(*args, **kwargs)[source]

Bases: evennia.objects.objects.DefaultObject

This implements a simple Object using the talk command and using the conversation defined above.

at_object_creation()[source]

This is called when object is first created.

exception DoesNotExist

Bases: evennia.objects.objects.DefaultObject.DoesNotExist

exception MultipleObjectsReturned

Bases: evennia.objects.objects.DefaultObject.MultipleObjectsReturned

path = 'evennia.contrib.tutorials.talking_npc.talking_npc.TalkingNPC'
typename = 'TalkingNPC'