Hi all,
Hope I can get some advice on this. I'm a newcomer to python coding, and I recently implemented being able to give their saves names in my current project.
It works fine with one exception - for some reason, the character limit I set is not being acknowledged, which will allow people to write straight off the window and give their save slots ridiculously long names. I've been all over the forums hoping to find a solution, but no dice.
Here's the code I'm using -
screen modal_input:
modal True
window at truecenter:
xmaximum 600
ymaximum 200
ypadding .5
xpadding .013
ypos 0.4
background("gui/saveinfoscreen.png")
text prompt style "input_prompt"
input id "input" style "input_text" default default
label get_save_name:
show screen save
$ save_name = renpy.call_screen("modal_input", prompt="Enter save information", default=save_name, length=25)
$ renpy.retain_after_load()
return
Any help with this issue would be appreciated!
[SOLVED] Input character limit not working
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
[SOLVED] Input character limit not working
Last edited by belphe on Sun Feb 24, 2019 12:22 pm, edited 2 times in total.
- Per K Grok
- Miko-Class Veteran
- Posts: 882
- Joined: Fri May 18, 2018 1:02 am
- Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
- itch: per-k-grok
- Location: Sverige
- Contact:
Re: Input character limit not working
try putting the length restriction in the line for the input insteadbelphe wrote: ↑Thu Dec 20, 2018 11:22 pm Hi all,
Hope I can get some advice on this. I'm a newcomer to python coding, and I recently implemented being able to name save slots in my current project.
It works fine with one exception - for some reason, the character limit I set is not being acknowledged, which will allow people to write straight off the window and give their save slots ridiculously long names. I've been all over the forums hoping to find a solution, but no dice.
Here's the code I'm using -
screen modal_input:
modal True
window at truecenter:
xmaximum 600
ymaximum 200
ypadding .5
xpadding .013
ypos 0.4
background("gui/saveinfoscreen.png")
text prompt style "input_prompt"
input id "input" style "input_text" default default
label get_save_name:
show screen save
$ save_name = renpy.call_screen("modal_input", prompt="Enter save information", default=save_name, length=25)
$ renpy.retain_after_load()
return
Any help with this issue would be appreciated!
Re: Input character limit not working
That worked! Thanks so much. I'd tried it before and gotten an error, but didn't think to take the "=" out. I appreciate you taking the time to help a novice :3Per K Grok wrote: ↑Fri Dec 21, 2018 2:23 am try putting the length restriction in the line for the input instead
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot]