Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def menunode_skill_input(caller, raw_string, **kwargs):
- player_input = raw_string
- logger.log_msg(f"player_input: {player_input}")
- text = ""
- skill = ""
- amt = ""
- n = 0
- change = 0
- failed = False
- if not player_input:
- failed = True
- else:
- if not " " in player_input:
- failed = True
- else:
- for n in player_input:
- logger.log_msg(f"n is: {n}")
- if n.isnumeric():
- amt += n
- else:
- skill += n
- logger.log_msg(f"Skills: {skill} | Amt: {amt}")
- if not skill or not amt:
- failed = True
- else:
- skill = skill.strip()
- amt = amt.strip()
- if failed:
- text += (f"You must include the skill name and amount to add.\nExample: |gAcrobatics 5|n.")
- options = {"key": "Continue",
- "desc": "Add Points",
- "goto": ("menunode_skills") }
- return text, options
- # The above is returning:
- # Menu node 'You must include the skill name and amount to add.
- # Example: Acrobatics 5.' is either not implemented or caused an error. Make another choice.
- # This is what it's supposed to go to:
- def menunode_skills(caller, raw_string, **kwargs):
- # etc etc...
- options = ({"key": "_default",
- "goto": (menunode_skill_input)},
- {"key":"Back",
- "desc":"Set Your stats",
- "goto": "menunode_assign_stats"})
- return text, options
- # And this other node works fine using the exact same return...
- def menunode_assign_skills(caller, raw_string, **kwargs):
- # etc etc ...
- options = ( {"key": "Continue",
- "desc": "Add Points",
- "goto": ("menunode_skills") },
- {"key":"Back",
- "desc":"Set Your Stats",
- "goto": "menunode_assign_stats"})
Add Comment
Please, Sign In to add comment