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)[源代码]
evennia.contrib.tutorials.talking_npc.talking_npc.info1(caller)[源代码]
evennia.contrib.tutorials.talking_npc.talking_npc.info2(caller)[源代码]
evennia.contrib.tutorials.talking_npc.talking_npc.info3(caller)[源代码]
evennia.contrib.tutorials.talking_npc.talking_npc.END(caller)[源代码]
class evennia.contrib.tutorials.talking_npc.talking_npc.CmdTalk(**kwargs)[源代码]

基类: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()[源代码]

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)[源代码]

基类:evennia.commands.cmdset.CmdSet

Stores the talk command.

key = 'talkingcmdset'
at_cmdset_creation()[源代码]

populates the cmdset

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

基类:evennia.objects.objects.DefaultObject

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

at_object_creation()[源代码]

This is called when object is first created.

exception DoesNotExist

基类:evennia.objects.objects.DefaultObject.DoesNotExist

exception MultipleObjectsReturned

基类:evennia.objects.objects.DefaultObject.MultipleObjectsReturned

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