Is there a way to create a popup window on invalid input?

Discuss macro implementations, ask for macro help (to share your creations, see User Creations, probably either Campaign Frameworks or Drop-in Resources).

Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice

Post Reply
User avatar
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?

Post by Shadowfireomega »

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

User avatar
aliasmask
RPTools Team
Posts: 9023
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Is there a way to create a popup window on invalid input?

Post by aliasmask »

Yes,

Code: Select all

continue = 1
while(continue), code: {
	inputInfo = getInput()
	errors = makeChecks(inputInfo)
	continue = errors
}	
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.

User avatar
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?

Post by Shadowfireomega »

Thank you! I will fiddle around with this after I finish restructuring my macro :D
"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

Post Reply

Return to “Macros”