Dialog Box Auto-Closing Upon Opening 2nd Time
I've been appending custom functionality to the simple worldbuilding system. At this time, I'm trying to loop over all actors and then use and their items to add things up and perform rolls. To add modifiers, I want to make a dialogue box pop up wherein I can type in additional modifiers/etc, such as +1att (give the attacker +1 advantage to their role under value)
The first time, it works! It prints verbose. That is the "building block" string for me to build additional logic on top of.
The 2nd time, the dialogue just instantly returns "" and then it doesn't print verbose.
Has anyone else had issues with Dialogues behaving so oddly? Why is my new Dailog instantly closing with no value?
3 Replies
I may be wrong. but isn't the "dialog" variable going out of scope after render has been called - and thus the Dialog object is deleted at the end of the function?
@Farling That's possible - I'm not familiar with how the internals work in terms of scoping. However, the FIRST render stays in-scope. Why would the second one suddenly not?
Can anyone assist with this? We've been stuck for over a month which means we aren't gettign the value out of the product. Here's the code so that you can repeat the issue:
We decided to go forward using prompt() for the time being
Use the
name
attribute instead of id. There is hardly ever any reason to use id attributes on forms.
And if you want an asynchronous dialog, use Dialog.prompt
or Dialog.wait
.
These are factory methods for this specific purpose.