When I add a scripting zone I see that it does not have any option to add a script to it. As such I assume that the intention is to use scripting zones with the onObjectEnterScriptingZone and onObjectLeavingScriptingZone events. However, as far as I know, there is no function to cause the player to drop the current object and thus any onObjectEnterScriptingZone or onObjectLeavingScriptingZone scripts can't manipulate (position or rotation) the object being carried into or out of the zone.
Consider a game like UNO or Crazy Eights. Lets say we want to create a play area (scripting zone) where players can play their cards and the script would evaluate if the play is legal and return the card if not.
If I trigger the script on onObjectEnterScriptingZone and then discover that the card being played is invalid then I cannot, as far as I can tell, return it because the user still has a hold of it.
As far as I can see, the work around would be to run a script on onObjectEnterScriptingZone which sets a global saying that the object is in the scripting zone. Then run a second script on onObjectLeavingScriptingZone and reset the global to indicate that the object is not in the scripting zone. Lastly create a third script that triggers on onObjectDropped which would perform the evaluation only if the global is set. This way, the evaluation gets performed after the object has been dropped and thus it could get returned if necessary.
Am I on the right track or is there a simpler way to do this that I am missing?
EDIT:
It occurs to me that if this is the case then it might be easier to use a simple onObjectDropped event and then just check the position against the bounds of the "scripting area" without actually using a scripting area.