Is there a way to create a popup window on invalid input?
Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice
- Shadowfireomega
- Giant
- Posts: 218
- Joined: Thu Dec 23, 2010 12:12 am
- Location: San Antonio, Texas
Is there a way to create a popup window on invalid input?
For my 5e character setup macro I have proficiency selections in each class field as well as the backgrounds portion (may be combining these soon). When a player hits ok on the window to choose proficiencies and tries to choose two of the same proficiencies, or a proficiency already gained from another source (from race, feat, background etc) it ends the macro and gives an error explaining why. This kicks them out of the macro completely and does not apply any change to the token, eg it makes them start again by running the macro again. Is there any way to have a popup window appear instead that will not take them out of the macro, but will not let them continue until the defined errors are fixed? (Image the 'you need to accept the terms and conditions' popups you get when you forget the checkbox on programs/websites).
"I love being wrong, for if I was always right, there would be nothing left to learn, and that would be a world I would not want to live in."
-Benjamin Fisher
"Knowledge is knowing a tomato is a fruit; wisdom is not putting it in a fruit salad."
-Miles Kington
"Space is his favorite thing in the world!"
-Kayla Kros
"Anything times 1 is 1"
-Kayla Kros
-Benjamin Fisher
"Knowledge is knowing a tomato is a fruit; wisdom is not putting it in a fruit salad."
-Miles Kington
"Space is his favorite thing in the world!"
-Kayla Kros
"Anything times 1 is 1"
-Kayla Kros
Re: Is there a way to create a popup window on invalid input?
Yes,
Basically, you wrap it in a loop and it loops until there are no errors. Exiting without completion you can put an abort around your input like this
abort(input(...)). That will allow you another way to exit the loop.
Code: Select all
continue = 1
while(continue), code: {
inputInfo = getInput()
errors = makeChecks(inputInfo)
continue = errors
}
abort(input(...)). That will allow you another way to exit the loop.
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
- Shadowfireomega
- Giant
- Posts: 218
- Joined: Thu Dec 23, 2010 12:12 am
- Location: San Antonio, Texas
Re: Is there a way to create a popup window on invalid input?
Thank you! I will fiddle around with this after I finish restructuring my macro
"I love being wrong, for if I was always right, there would be nothing left to learn, and that would be a world I would not want to live in."
-Benjamin Fisher
"Knowledge is knowing a tomato is a fruit; wisdom is not putting it in a fruit salad."
-Miles Kington
"Space is his favorite thing in the world!"
-Kayla Kros
"Anything times 1 is 1"
-Kayla Kros
-Benjamin Fisher
"Knowledge is knowing a tomato is a fruit; wisdom is not putting it in a fruit salad."
-Miles Kington
"Space is his favorite thing in the world!"
-Kayla Kros
"Anything times 1 is 1"
-Kayla Kros