Scripting Bugs

  • Search existing bugs before submitting
  • Use support.secondlife.com for customer support issues
  • Keep posts on-topic
Objects rezzed with llRezObjectWithParams with REZ_FLAG_DIE_ON_COLLIDE ignore llCollisionFilter settings
An object rezzed with llRezObjectWithParams that has the flag REZ_FLAG_DIE_ON_COLLIDE set on it does not obey any filter applied by llCollisionFilter. That is, if an object has a script in it that sets a filter to ignore collision with some object, it will still die on collision with that object if the DIE_ON_COLLIDE setting was used. This obviously breaks legacy behavior and makes the new rez method less flexible than the old method. I posted a feature request in the combat2 section before I realized there's actually a bug here as well. This post covers the actual bug between llRezObjectWithParams and llCollisionFilter. You can see my suggestion here: https://feedback.secondlife.com/combat-20/p/add-rez-collision-filter-parameter-to-llrezobjectwithparams To reproduce: Create an object called "ObjectA" with gravity set to 0 and this script in it default { state_entry() { llCollisionFilter("ObjectB", NULL_KEY, FALSE); } } Create a rezzing object with ObjectA in it and this script default { touch_start(integer total_number) { list rez_params = [REZ_FLAGS, REZ_FLAG_PHYSICAL | REZ_FLAG_DIE_ON_COLLIDE, REZ_POS, llGetPos()+<0.0, 0.0, 1.5>, FALSE, FALSE]; llRezObjectWithParams("ObjectA", rez_params); } } Now place an object called "ObjectB". Touch the rezzing object, then drag ObjectA that appears until it collides with ObjectB. You will observe that ObjectA dies despite the fact that collisions with ObjectB are suppressed by llCollisionFilter. You could argue that this is "working as designed" and that it's correct for REZ_FLAG_DIE_ON_COLLIDE not to be influenced by llCollisionFilter. However, back before llRezObjectsWithParams came along and an object had to have its own script to destroy itself on collision, it was useful to filter out some object by name from this behavior. There is no such capability of filtering collisions by object name with llRezObjectWithParams, so the only solution is to do things the old way, giving up the improvements made possible by this new rez API. It would be better overall for LSL development to maintain this filtered collision behavior in the new method.
0
llRezObjectWithParams flag REZ_FLAG_NO_COLLIDE_FAMILY causes first instance of rezzed object to receive no collision_start events at all
Using the flag REZ_FLAG_NO_COLLIDE_FAMILY with llRezObjectWithParams() causes the first object rezzed not to receive any collision_start events at all no matter how many collisions it has. All subsequent rezzes of the same object do receive collision_start events as expected. This problem seems to be subject to a "caching effect" such that it only happens the first time the object is rezzed on a given sim. It has been difficult to characterize the behavior exactly since it only happens once per sim per some very long time (sim seems to "remember" the object and not have the issue for some number of hours). However, it does seem like the "memory" works across different owners' instances of the same rezzed object, e.g. agent A uses laucher to rez projectile, which exhibits the failure, then agent B uses same launcher the same way and does not experience the issue. I also did not attempt to investigate collision and collision_end events, but I strongly suspect these have the same issue. I have created a minimal example to replicate the issue. You can use these scripts to reproduce it, or contact me in world and I will give you my example object. Launcher script default { touch_start(integer num_detected) { rotation my_rot = llGetRot(); vector rez_pos = llGetPos() + <5.0, 0.0, 0.0> * my_rot; vector velocity = llRot2Fwd(my_rot) * 200.0; list params = [ REZ_FLAGS, REZ_FLAG_TEMP | REZ_FLAG_PHYSICAL | REZ_FLAG_NO_COLLIDE_FAMILY, REZ_LOCK_AXES, <1.0, 1.0, 1.0>, REZ_POS, rez_pos, FALSE, FALSE, REZ_ROT, my_rot, FALSE, REZ_VEL, velocity, FALSE, FALSE ]; llRezObjectWithParams("projectile", params); } } Projectile script default { on_rez(integer param) { llOwnerSay("on_rez param="+(string)param); } collision_start(integer num_detected) { llOwnerSay("Collided with: "+llDetectedName(0)); llSetTimerEvent(4.0); } timer() { llDie(); } } You can see a video of the behavior here: https://gyazo.com/41bf8753ec3d82243109df5db86a8acc Notice in the lower left chat text how the first projectile reports only its on_rez event, then the second one reports on_rez and collision_start. In fact, if you look closely you can see both projectiles bounce back and forth a few times hitting an object out of frame to the left. The first one gets none of the collision_start events while the second gets them all.
5
·

tracked

Load More