Exit event for LUA
| Case number: | 845813-987743 |
| Topic: | Game: Tools |
| Opened by: | Pletsch |
| Status: | Done |
| Assigned: | beta_helix |
| Priority: | 3 |
| Type: | Suggestion |
| Opened on: | Saturday, May 22, 2010 - 21:56 |
| Last modified: | Thursday, July 19, 2012 - 08:17 |
Is it possible to allow for an exit event for LUA scripts to process code before returning control to the user ?
This would be helpful for things such as restoring structure, or passing notes if a script is ended prematurely before the script has finished.
Perhaps a user-defined function with a specific name that is searched for when canceling a script ?
... and it would not give negative score impacts in the recipe's statistic, if it was cancelled.
How about a sound if a recipe has finished?
Another Question:
Why do scripts, which only put out some text give a negative score impact?
It should be 0, as they don't do any changes on the puzzle.
A canceled script should not report any score change to the server. If the script doesn't run all the way through, then you aren't getting a good evaluation of the potential of the script. Many scripts do something to the structure that causes a negative score, then does something else that gets a positive score. If the user stops the script in between the negative score gets reported.
Alternately, if the canceling can trigger other code, I could at least restore to the best score before exiting.
I second that.
| Status: Open » Done |
Done in V2 lua, example:
http://fold.it/portal/node/991496#comment-16717



This is not identical, but similar to, the lua_atpanic() function.