Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def at_talk(self, caller):
- """
- Called when obj targeted by a talk command.
- """
- conversation = {}
- exec(self.db.conversation)
- EvMenu(
- caller,
- conversation,
- startnode="node1",
- persistent=False,
- cmd_on_exit=None,
- )
- ----------------------------------------------
- lab_aide = create_object(characters_trainers.Trainer, key="Lab Aide",
- aliases=["Aide"], location=laboratory)
- lab_aide.db.conversation = """
- def node1(caller):
- text = "I study POKEMON as PROF.OAK'S AIDE."
- options = None
- return utils_text.nobordertext(text, "Lab Aide"), options
- conversation = {"node1": node1}
- """
- ------------------------------------------------
- Results in:
- Traceback (most recent call last):
- File "/home/ubuntu/environment/evennia/evennia/commands/cmdhandler.py", line 631, in _run_command
- ret = cmd.func()
- File "./features/NPCs.py", line 59, in func
- target.at_talk(caller)
- File "./features/NPCs.py", line 97, in at_talk
- cmd_on_exit=None,
- File "/home/ubuntu/environment/evennia/evennia/utils/evmenu.py", line 445, in __init__
- raise EvMenuError("Start node '%s' not in menu tree!" % startnode)
- evennia.utils.evmenu.EvMenuError: Start node 'node1' not in menu tree!
- An untrapped error occurred.
- (Traceback was logged 19-10-15 12:33:35).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement