DarkEmperor13 Posted September 3, 2019 Share Posted September 3, 2019 Hiya I've made a go kart and trying to figure out this error; "Too many errors... dropping further messages until the flood stop". My script is as followed: //Feel free to modify these basic parameters to suit your needs. float forward_power = 20; //Power used to go forward (1 to 30) float reverse_power = -15; //Power ued to go reverse (-1 to -30) float turning_ratio = 4.0; //How sharply the vehicle turns. Less is more sharply. (.1 to 10) string sit_message = "Jump In!"; //Sit message string not_owner_message = "You are not the owner of this vehicle ..."; //Not owner message //Anything past this point should only be modfied if you know what you are doing string last_wheel_direction; string cur_wheel_direction; default { state_entry() { llSitTarget(<0,0,.2>,llEuler2Rot(<0.0,0.0,0>*DEG_TO_RAD)); llSetSitText(sit_message); llSetCameraEyeOffset(<-10.0, 0.0, 2.0> ); llSetCameraAtOffset(<10.0, 0.0, 2.0> ); //car llSetVehicleType(VEHICLE_TYPE_CAR); llSetVehicleFloatParam(VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY, 0.2); llSetVehicleFloatParam(VEHICLE_LINEAR_DEFLECTION_EFFICIENCY, 0.80); llSetVehicleFloatParam(VEHICLE_ANGULAR_DEFLECTION_TIMESCALE, 0.10); llSetVehicleFloatParam(VEHICLE_LINEAR_DEFLECTION_TIMESCALE, 0.10); llSetVehicleFloatParam(VEHICLE_LINEAR_MOTOR_TIMESCALE, 1.0); llSetVehicleFloatParam(VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE, 0.2); llSetVehicleFloatParam(VEHICLE_ANGULAR_MOTOR_TIMESCALE, 0.1); llSetVehicleFloatParam(VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE, 0.5); llSetVehicleVectorParam(VEHICLE_LINEAR_FRICTION_TIMESCALE, <1000.0, 2.0, 1000.0> ); llSetVehicleVectorParam(VEHICLE_ANGULAR_FRICTION_TIMESCALE, <10.0, 10.0, 1000.0> ); llSetVehicleFloatParam(VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY, 0.50); llSetVehicleFloatParam(VEHICLE_VERTICAL_ATTRACTION_TIMESCALE, 0.50); } changed(integer change) { if (change & CHANGED_LINK) { key agent = llAvatarOnSitTarget(); if (agent) { if (agent != llGetOwner()) { llSay(0, not_owner_message); llUnSit(agent); llPushObject(agent, <0,0,50>, ZERO_VECTOR, FALSE); } else { llTriggerSound("Kart Start",1); llSleep(.4); llSetStatus(STATUS_PHYSICS, TRUE); llSleep(.1); llRequestPermissions(agent, PERMISSION_TRIGGER_ANIMATION | PERMISSION_TAKE_CONTROLS); llSetTimerEvent(0.1); llLoopSound("Kart Idle",1); } } else { llSetTimerEvent(0); llStopSound(); llSetStatus(STATUS_PHYSICS, FALSE); llSleep(.1); llSleep(.4); llReleaseControls(); llResetScript(); } } } run_time_permissions(integer perm) { if (perm) { llStartAnimation("Go Kart Sit"); llTakeControls(CONTROL_FWD | CONTROL_BACK | CONTROL_DOWN | CONTROL_UP | CONTROL_RIGHT | CONTROL_LEFT | CONTROL_ROT_RIGHT | CONTROL_ROT_LEFT, TRUE, FALSE); } } control(key id, integer level, integer edge) { integer reverse=1; vector angular_motor; //get current speed vector vel = llGetVel(); float speed = llVecMag(vel); //car controls if(level & CONTROL_FWD) { llLoopSound("Kart Drive 03", 1); cur_wheel_direction = "WHEEL_FORWARD"; llSetVehicleVectorParam(VEHICLE_LINEAR_MOTOR_DIRECTION, <forward_power,0,0> ); reverse=1; } if(edge & CONTROL_FWD) { llLoopSound("Kart Idle",1); } if(level & CONTROL_BACK) { cur_wheel_direction = "WHEEL_REVERSE"; llSetVehicleVectorParam(VEHICLE_LINEAR_MOTOR_DIRECTION, <reverse_power,0,0> ); reverse = -1; } if(level & (CONTROL_RIGHT|CONTROL_ROT_RIGHT)) { llStartAnimation("Go Kart Right"); angular_motor.z -= speed / turning_ratio * reverse; } if(edge & (CONTROL_RIGHT|CONTROL_ROT_RIGHT)) { llStopAnimation("Go Kart Right"); } if(level & (CONTROL_LEFT|CONTROL_ROT_LEFT)) { llStartAnimation("Go Kart Left"); angular_motor.z += speed / turning_ratio * reverse; } if(edge & (CONTROL_LEFT|CONTROL_ROT_LEFT)) { llStopAnimation("Go Kart Left"); } llSetVehicleVectorParam(VEHICLE_ANGULAR_MOTOR_DIRECTION, angular_motor); } //end control timer() { if (cur_wheel_direction != last_wheel_direction) { } } } //end default Link to comment Share on other sites More sharing options...
Rolig Loon Posted September 3, 2019 Share Posted September 3, 2019 It might help to know what error messages are leading up to this one. Are you listening on DEBUG_CHANNEL or watching in the script popup window? Link to comment Share on other sites More sharing options...
Nova Convair Posted September 3, 2019 Share Posted September 3, 2019 Are you aware that the control event is constantly triggered when you hold down a key? Every bug here will flood you in no time. The error message tells you what the problem is. Link to comment Share on other sites More sharing options...
DarkEmperor13 Posted September 3, 2019 Author Share Posted September 3, 2019 19 minutes ago, Nova Convair said: Are you aware that the control event is constantly triggered when you hold down a key? Every bug here will flood you in no time. The error message tells you what the problem is. so ur saying that its caused by the control event constantly triggered? Link to comment Share on other sites More sharing options...
Rolig Loon Posted September 3, 2019 Share Posted September 3, 2019 4 minutes ago, DarkEmperor13 said: so ur saying that its caused by the control event constantly triggered? The flooding is, yes, but all that's telling you is that there's something else wrong. Otherwise there wouldn't be a pile of error messages accumulating. So, what is the basic error message that you are getting (not the "flooding" message) ? Link to comment Share on other sites More sharing options...
DarkEmperor13 Posted September 3, 2019 Author Share Posted September 3, 2019 thats all it says and to ur question before rolig, its the popup error window Link to comment Share on other sites More sharing options...
Mollymews Posted September 4, 2019 Share Posted September 4, 2019 the error messages are probably caused by the named animations and sounds not being found in the vehicles Contents suggest that to begin with you comment out ( // ) all the llStartAnimation, llStopAnimation, llTriggerSound and llLoopSound in the script to first get the vehicle moving then obtain animation and sound files appropriate to the vehicle and put them into the Contents with the script. Editing the script so that the script-named animations and sounds match those in Contents Link to comment Share on other sites More sharing options...
DarkEmperor13 Posted September 4, 2019 Author Share Posted September 4, 2019 except they are in the contents otherwise it would just say cannot find this animation or sound Link to comment Share on other sites More sharing options...
Mollymews Posted September 4, 2019 Share Posted September 4, 2019 can you give more info on when the error message starts how many times does the error message appear ? does the error message start when its rezzed ? when you sit on it ? when you press a key ? if key then what key ? etc Link to comment Share on other sites More sharing options...
Wulfie Reanimator Posted September 4, 2019 Share Posted September 4, 2019 (edited) Just looking at the code, looks like it's gonna be a math error because of division by speed in the control event. When the vehicle is stationary, speed is 0.0 and you can't use that for division. Edited September 4, 2019 by Wulfie Reanimator 1 Link to comment Share on other sites More sharing options...
Rolig Loon Posted September 4, 2019 Share Posted September 4, 2019 41 minutes ago, Wulfie Reanimator said: Just looking at the code, looks like it's gonna be a math error because of division by speed in the control event. When the vehicle is stationary, speed is 0.0 and you can't use that for division. Hmmm.. I don't see anywhere in the code where a quantity is divided by speed. I see only 23 hours ago, DarkEmperor13 said: angular_motor.z -= speed / turning_ratio * reverse; and 23 hours ago, DarkEmperor13 said: angular_motor.z += speed / turning_ratio * reverse; Link to comment Share on other sites More sharing options...
Madelaine McMasters Posted September 4, 2019 Share Posted September 4, 2019 I put the script in a cube and commented out all the sound and animation calls (cuz I have no sounds or animations) and it seems to work. I ran over a couple people in a sandbox and I like the little nose dive when you come to a stop, like an old car with squishy springs and bad shocks. With the sound/animation calls in, I get the expected trail of errors because the sound and animation files can't be found in the object's inventory, but those come along at an observable pace. 1 Link to comment Share on other sites More sharing options...
Wulfie Reanimator Posted September 4, 2019 Share Posted September 4, 2019 (edited) 20 minutes ago, Rolig Loon said: Hmmm.. I don't see anywhere in the code where a quantity is divided by speed. Those parts were exactly what I was referring to, but it turns out speed is almost never exactly 0 and there's no math error even when it is. But I've just tried running the script in-world (only changes I made was commenting out trigger/loopsound and startanimation. No errors anywhere. Edited September 4, 2019 by Wulfie Reanimator Link to comment Share on other sites More sharing options...
Nova Convair Posted September 4, 2019 Share Posted September 4, 2019 (edited) There is no division with speed as the divisor in the code so thats no problem. The only divisor is turning_ratio and that is a constant. And - scripts crash on division by zero errors and don't generate more errors then. The only terms that can generate errors are llLoopSound, llStartAnimation, llStopAnimation - this ones generate an error in the debug window for a missing animation (or a misspelled one) Missing permissions can happen too in theory but then the error is shouted instead of the debug window so that would have been recognized. Edit: Wulfie - it doesn't matter if speed is zero - look at the division again. Edited September 4, 2019 by Nova Convair 1 2 Link to comment Share on other sites More sharing options...
Mollymews Posted September 5, 2019 Share Posted September 5, 2019 a FYI met up with Dark inworld and we had a look at it all the named sound and animation files were present in Contents the flooding error message that Dark was getting was caused by calling llLoopSound in the control key press event if(level & CONTROL_FWD) { llLoopSound("Kart Drive 03", 1); } the error went away for Dark when rewrote the code to better handle keydown, keypress and keyup. Playing llLoopSound in the keydown event. Example if ((level & CONTROL_FWD) && (edge & CONTROL_FWD)) { // key down llLoopSound("Kart Drive 03", 1); } else if (level & CONTROL_FWD) { // key press llSetVehicleVectorParam(VEHICLE_LINEAR_MOTOR_DIRECTION, <forward_power,0,0> ); } else if (edge & CONTROL_FWD) { // key up llLoopSound("Kart Idle",1); } a tiny issue was that I couldn't actually replicate the error message that Dark was getting. Not sure why I couldn't replicate it as originally wrote. However Dark came away with a better understanding of control key event handling so all good 2 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now