evennia.contrib.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. Create it by creating an object of typeclass contrib.talking_npc.TalkingNPC, For example using @create:

@create/drop John : contrib.talking_npc.TalkingNPC

Walk up to it and give the talk command to strike up 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.talking_npc.menu_start_node(caller)[source]
evennia.contrib.talking_npc.info1(caller)[source]
evennia.contrib.talking_npc.info2(caller)[source]
evennia.contrib.talking_npc.info3(caller)[source]
evennia.contrib.talking_npc.END(caller)[source]
class evennia.contrib.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', '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.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.talking_npc.TalkingCmdSet'
class evennia.contrib.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.talking_npc.TalkingNPC'
typename = 'TalkingNPC'