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 ?

(Sat, 05/22/2010 - 21:56  |  7 comments)


Joined: 04/27/2010

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

Joined: 09/18/2009
Groups: SETI.Germany

... and it would not give negative score impacts in the recipe's statistic, if it was cancelled.

Joined: 09/18/2009
Groups: SETI.Germany

How about a sound if a recipe has finished?

Joined: 09/18/2009
Groups: SETI.Germany

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.

Tlaloc's picture
User offline. Last seen 19 hours 35 min ago. Offline
Joined: 08/04/2008
Groups: Mojo Risin'

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.

Joined: 09/18/2009
Groups: SETI.Germany

I second that.

Joined: 06/17/2010
Status: Open » Done

Done in V2 lua, example:
http://fold.it/portal/node/991496#comment-16717

Sitemap

Supported by: UW Center for Game Science, UW Department of Computer Science and Engineering, UW Baker Lab, DARPA, NSF, HHMI, Microsoft, and Adobe