Bridgette Puddles Posted July 25, 2023 Share Posted July 25, 2023 about to pull my hair out lol, so I have been trying to get this to work for 3 hours and it's not slowing my speed down. any idea what I'm doing wrong? float IMPULSE = 5.6; key id = NULL_KEY; default { state_entry() { llSetForce(<0,0,0>, TRUE); id = llGetOwner(); llRequestPermissions(id,PERMISSION_TAKE_CONTROLS); } run_time_permissions(integer perm) { if(perm & PERMISSION_TAKE_CONTROLS) { llTakeControls (CONTROL_FWD|CONTROL_BACK|CONTROL_LEFT|CONTROL_RIGHT|CONTROL_UP|CONTROL_DOWN,TRUE,TRUE); } } control(key id, integer level, integer edge) { if(level & CONTROL_FWD) { if(llGetAgentInfo(llGetOwner()) & AGENT_WALKING) { llApplyImpulse(<IMPULSE.0,0,0>,TRUE); } } } } Link to comment Share on other sites More sharing options...
rasterscan Posted July 25, 2023 Share Posted July 25, 2023 (edited) llApplyImpulse(<IMPULSE.0,0,0>,TRUE); Looks wrong. Try llApplyImpulse(IMPULSE,TRUE); or llApplyImpulse(<IMPULSE,0,0>,TRUE); I'm guessing here. Forgive me if it don't help Edited July 25, 2023 by rasterscan Link to comment Share on other sites More sharing options...
elleevelyn Posted July 25, 2023 Share Posted July 25, 2023 apply negative impulse to slow the avatar discussion here Link to comment Share on other sites More sharing options...
Fenix Eldritch Posted July 25, 2023 Share Posted July 25, 2023 (edited) 10 hours ago, Bridgette Puddles said: llApplyImpulse(<IMPULSE.0,0,0>,TRUE); This won't even compile. When you have a dot immediately after a variable, without a space, the compiler will interpret it as an acceessor operator. These are used to reference individual elements of specific variable types like the XYZ of a vector or the XYZS of a rotation. IMPULSE is a float, so that operator doesn't apply (nor does it make sense to try and access the "0 component". Remove the ".0" from both instances in your script. Secondly, IMPULSE is a positive number. Applying that to your avatar will result in an increase in speed. If you want to reduce speed, use a negative number. Lastly, llApplyImpulse implicitly targets the object the script is in, which has to be physical (or in the case of avatars, a worn attachment). If you want to apply the impulse to your avatar, you must be wearing the object as an attachment. Edited July 25, 2023 by Fenix Eldritch 2 1 Link to comment Share on other sites More sharing options...
Quistess Alpha Posted July 25, 2023 Share Posted July 25, 2023 (edited) Making the avatar walk at a specific speed is non-trivial if you want other nice things like being able to walk up stairs/tiny ledges, and not fly backwards when trying to go forwards while falling. I have a few different implementations in my "fine for personal use, but probably not good enough for a general-use product" bin of 95% finished products. see: Edited July 25, 2023 by Quistess Alpha 1 Link to comment Share on other sites More sharing options...
LoneWolfiNTj Posted July 26, 2023 Share Posted July 26, 2023 18 hours ago, Bridgette Puddles said: llApplyImpulse(<IMPULSE.0,0,0>,TRUE); To make that work, you'd need to get rid of the ".0" on the end of "IMPULSE": llApplyImpulse(<IMPULSE, 0, 0>, TRUE); Link to comment Share on other sites More sharing options...
Bridgette Puddles Posted July 26, 2023 Author Share Posted July 26, 2023 Thank you Quistess Alpha, With some cleaning and changing a few lines in your Movement and animation Override script I was able to slow down the av speed. Even worked better than I hoped it would, I no longer have to track the walk running end with the modding I did with it you are not able to use run/always run over riding the speed API. 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