Sending an incoming question to the player is/was, in my opinion, a quite complicated thing to do, so people just did not do it. The following problems annoyed me most:
- To send a question, you always had to have a special callback-script which disturbed you normal script naming schemes and added a lot to the work involved
- Callback scripts ran global, so if you expected more than one question asked, you had to work with global variables and needed even more time to fiddle all out
- All Questions were logged to the player logbook and created loads of spam
- There was no "popup"-argument in "send incoming question"
- can be called from any script on any object and returns the answer as soon as one is given
- can run as many questions as wanted at one time, with one being picked at random everytime the player answers a question
- do not get logged to the player logbook
- do pop up once issued
Download:
[ external image ]
Quick-"How to use this" (for scripters):
* Download package and read readme
* Place scriptfiles in "scripts", MD-files in "director"
* call script "lib.st.md.message.ask.xml" whenever you want to ask a question
* note that
** it might take hours for the player to answer a question if he decides not to
** the retvar is always a string or integer, never an object or any of the kind
Example: Simple script for offering the player some money and give it to him if he wants it:
Textfile:
[ external image ]
Scriptfile (recommended solution):
[ external image ]
Scriptfile (alternative solution):
[ external image ]
Changelog:
1.0 initial release
1.5 bugfix: errors could ocurr (leading to no questions being asked anymore) when an object that was just asking a question got destroyed. Added code to handle this situation in lib.st.md.message.ask.xml