This thread looks like a good place to post this little patch, which adds a kill() function to asteroids. With this, scripts can actually kill asteroids, whereas previously you'd have needed to spawn a fake weapon to hit and destroy them.
Index: lua.cpp
===================================================================
--- lua.cpp (revision 7927)
+++ lua.cpp (working copy)
@@ -4627,6 +4627,30 @@
}
+ADE_FUNC(kill, l_Asteroid, "[ship killer=nil, wvector hitpos=nil]", "Kills the asteroid. Set \"killer\" to designate a specific ship as having been the killer, and \"hitpos\" to specify the world position of the hit location; if nil, the asteroid center is used.", "boolean", "True if successful, false or nil otherwise")
+{
+ object_h *victim,*killer=NULL;
+ vec3d *hitpos=NULL;
+ if(!ade_get_args(L, "o|oo", l_Asteroid.GetPtr(&victim), l_Ship.GetPtr(&killer), l_Vector.GetPtr(&hitpos)))
+ return ADE_RETURN_NIL;
+
+ if(!victim->IsValid())
+ return ADE_RETURN_NIL;
+
+ if(killer != NULL && !killer->IsValid())
+ return ADE_RETURN_NIL;
+
+ if (!hitpos)
+ hitpos = &victim->objp->pos;
+
+ if (killer)
+ asteroid_hit(victim->objp, killer->objp, hitpos, victim->objp->hull_strength + 1);
+ else
+ asteroid_hit(victim->objp, NULL, hitpos, victim->objp->hull_strength + 1);
+
+ return ADE_RETURN_TRUE;
+}
+
//**********HANDLE: Shipclass
ade_obj<int> l_Shipclass("shipclass", "Ship class handle");
extern int ships_inited;