Creating a Mono script with a control event triggers a runtime error whenever the control event triggers:
"Script run-time error
System.ArgumentException: parameters
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000]
at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000]
at LindenLab.SecondLife.LslUserScript.OnEvent (ScriptEvent evt) [0x00000]
at LindenLab.SecondLife.Script.Run (ScriptEvent evt) [0x00000] "
Repro:
Create the following script and place it in an object:
default
{
state_entry()
{
llRequestPermissions(llGetOwner(), PERMISSION_TAKE_CONTROLS);
}
run_time_permissions(integer perm)
{
llOwnerSay("permissions "+(string)perm);
if (perm & (PERMISSION_TAKE_CONTROLS))
{
llTakeControls(CONTROL_UP | CONTROL_DOWN | CONTROL_FWD | CONTROL_BACK | CONTROL_RIGHT | CONTROL_LEFT | CONTROL_ROT_RIGHT | CONTROL_ROT_LEFT | CONTROL_ML_LBUTTON | CONTROL_LBUTTON, TRUE, FALSE);
}
}
control(key id, integer level, integer edge)
{
llOwnerSay("control "+(string)level+" "+(string)edge);
}
}
After the object is granted control permissions, pressing any of the controlled keys results in the runtime error listed above. The LSL2 version of this script does not have this problem.