-
Notifications
You must be signed in to change notification settings - Fork 0
[BUG-228399] Script deletion disables vehicle controls until re-rez #6499
Comments
Tapple Gao commented at 2020-03-29T15:05:48Z I checked the release notes for the simulator version running at Teegle sim: https://releasenotes.secondlife.com/simulator/2020-03-17T20%3A08%3A11.538605.html "Fixes for object_rez timing in scripts" sounds like it might be related to this vehicle initialization on rez bug |
Teager commented at 2020-03-29T20:31:21Z The first reported case of this bug came in somewhere between March 5th and March 10th. Second and third cases were reported on March 12th and 13th. And as of today we've found that the bug reliably reproduces using the steps Tapple mentioned above.
The last version of our updater, released in January, previously resulted in the horse deleting and reinstalling its vehicle script, then wandering away as expected. Now using the same updater results in the horse falling over like a regular physical object |
Maestro Linden commented at 2020-03-30T18:05:07Z Thanks for the report. After reproducing the bug, I added a few lines of debug logging to the script to see where it's failing: vector fwd_vel = <16,0,0>;
vector left_vel = <0,0,-4>;
default {
control(key id, integer level, integer edge) {
if(level & CONTROL_FWD) {
llSetVehicleVectorParam(VEHICLE_LINEAR_MOTOR_DIRECTION, fwd_vel);
} else if(level & CONTROL_BACK) {
llSetVehicleVectorParam(VEHICLE_LINEAR_MOTOR_DIRECTION, -1.0 * fwd_vel);
} else {
llSetVehicleVectorParam(VEHICLE_LINEAR_MOTOR_DIRECTION, ZERO_VECTOR);
}
if(level & (CONTROL_RIGHT|CONTROL_ROT_RIGHT)) {
llSetVehicleVectorParam(VEHICLE_ANGULAR_MOTOR_DIRECTION, left_vel);
} else if(level & (CONTROL_LEFT|CONTROL_ROT_LEFT)) {
llSetVehicleVectorParam(VEHICLE_ANGULAR_MOTOR_DIRECTION, -1.0 * left_vel);
} else {
llSetVehicleVectorParam(VEHICLE_ANGULAR_MOTOR_DIRECTION, ZERO_VECTOR);
}
}
changed(integer change) {
if (change & CHANGED_LINK) {
key agent = llAvatarOnSitTarget();
if (agent) {
llOwnerSay("Agent sat on me - requesting controls permission and enabling physics.");
llRequestPermissions(agent, PERMISSION_TAKE_CONTROLS);
llSetStatus(STATUS_PHYSICS, TRUE);
} else {
llOwnerSay("Agent stood up - releasing controls and disabling physics");
llReleaseControls();
llSetStatus(STATUS_PHYSICS, FALSE);
}
}
}
on_rez(integer a) {
llResetScript();
}
state_entry() {
llSitTarget(<0.6,0,0.7>, ZERO_ROTATION);
llSetCameraEyeOffset(<-6.0, 0.0, 2.0>);
llSetCameraAtOffset(<2.0, 0.0, 1.0>);
llSetVehicleType(VEHICLE_TYPE_CAR);
}
run_time_permissions(integer perm) {
llOwnerSay("run_time_permissions triggered with perm = " + (string)perm);
if (perm) {
llTakeControls(
CONTROL_FWD | CONTROL_BACK |
CONTROL_RIGHT | CONTROL_LEFT |
CONTROL_ROT_RIGHT | CONTROL_ROT_LEFT |
CONTROL_UP | CONTROL_DOWN, TRUE, FALSE);
}
}
} In step (5), the script detects that the user sat, enables physics successfully, and gets PERMISSION_TAKE_CONTROLS successfully. The problem seems to be that |
Tapple Gao commented at 2020-03-31T14:33:53Z, updated at 2020-03-31T15:17:32Z I added another attachment (simple car debug) with Maestro's llOwnerSay commands, and also hovertext in the control event. llTakeControls seems to work for me; I delete the script, re-add, sit, and then press arrow keys. The hovertext reports the keypresses as expected, but the vehicle doesn't drive. Also, try performing this test on a hill. The vehicle will just slide or roll down the hill out of control on sit after delete/re-add |
Rider Linden commented at 2020-04-08T22:01:11Z There is a workaround for the time being. Modify the changed event as follows:
changed(integer change) {
if (change & CHANGED_LINK) {
key agent = llAvatarOnSitTarget();
if (agent) {
llSetVehicleType(VEHICLE_TYPE_CAR);
llOwnerSay("Agent sat on me - requesting controls permission and enabling physics.");
llRequestPermissions(agent, PERMISSION_TAKE_CONTROLS);
llSetStatus(STATUS_PHYSICS, TRUE);
} else {
llSetVehicleType(VEHICLE_TYPE_NONE);
llOwnerSay("Agent stood up - releasing controls and disabling physics");
llReleaseControls();
llSetStatus(STATUS_PHYSICS, FALSE);
}
}
} Note that we are setting the vehicletype to car as the agent sits down and then changing it to none when they stand up.
|
Uh oh!
There was an error while loading. Please reload this page.
When a user or update script replaces a vehicle script (rather than resetting the script), that prim can no longer use vehicle physics it is taken and re-rezzed
Steps to reproduce:
add the attached script "simple car" to a cube
sit on the cube. you should be able to drive it. Stand back up when done
delete "simple car" from the cube
add "simple car" back into the cube
sit on the cube again. It is no longer drivable (expected behavior: it is still drivable)
pick up the cube, and re-rez it
sit on the cube again. It is now drivable again
If you replace steps 3-4 with "reset the script", the bug does not appear
Other information
We discovered this bug while using the Teeglepet updater, which deletes and replaces the scripts and animations with a new version (Teeglepet is a ridable animesh horse, and includes vehicle physics). Customers suddenly began reporting this problem around 2020-03-15, This was unexpected, as none of the scripts had changed since January. We suspect this bug was introduced in a simulator update deployed sometime in March 2020. (I cannot confirm this, as I have no access to older simulator versions)
Attachments
Links
Related
Duplicates
Original Jira Fields
The text was updated successfully, but these errors were encountered: