Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. def at_talk(self, caller):
  2. """
  3. Called when obj targeted by a talk command.
  4. """
  5. conversation = {}
  6. exec(self.db.conversation)
  7.  
  8. EvMenu(
  9. caller,
  10. conversation,
  11. startnode="node1",
  12. persistent=False,
  13. cmd_on_exit=None,
  14. )
  15.  
  16. ----------------------------------------------
  17.  
  18. lab_aide = create_object(characters_trainers.Trainer, key="Lab Aide",
  19. aliases=["Aide"], location=laboratory)
  20.  
  21. lab_aide.db.conversation = """
  22. def node1(caller):
  23. text = "I study POKEMON as PROF.OAK'S AIDE."
  24. options = None
  25. return utils_text.nobordertext(text, "Lab Aide"), options
  26.  
  27. conversation = {"node1": node1}
  28. """
  29.  
  30. ------------------------------------------------
  31.  
  32. Results in:
  33.  
  34. Traceback (most recent call last):
  35. File "/home/ubuntu/environment/evennia/evennia/commands/cmdhandler.py", line 631, in _run_command
  36. ret = cmd.func()
  37. File "./features/NPCs.py", line 59, in func
  38. target.at_talk(caller)
  39. File "./features/NPCs.py", line 97, in at_talk
  40. cmd_on_exit=None,
  41. File "/home/ubuntu/environment/evennia/evennia/utils/evmenu.py", line 445, in __init__
  42. raise EvMenuError("Start node '%s' not in menu tree!" % startnode)
  43. evennia.utils.evmenu.EvMenuError: Start node 'node1' not in menu tree!
  44.  
  45. An untrapped error occurred.
  46. (Traceback was logged 19-10-15 12:33:35).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement