Jump to content

NVSE based player Movement Script: needs optimization, slight debuggin


angelwraith

Recommended Posts

Ok so here is the script i am using for a device that acts somewhat like tcl outside at the push of a button by moving around an invisible ball under the player so they always have a surface to walk on. then it moves the player a small amount each frame each movement key is pressed. i had all eight directions but i couldn't figure out how to set up button priority with the if and elseif so that if two buttons were presses at the same time it acted appropriately.

 

ok what this post is really about:

  1. a bug where if using the device for a reeeeaaaally long time for some reason RARELY the ball surface underneath will stop updating, which if you're really high leaves you in a world of hurt cause that sudden stop....
  2. i know what i did here is inefficient.. and clunky. (especially in the way it enables and disables with those two separate variables).. however it does work. And i believe that with the knowledge here between you all, for sure it can be tidied up a bit to where itll run smoother (its pretty smooth as is, nevertheless i think you all can do better..) and maybe even eliminate that bug with teh surface not updating as well.
  3. wish list: a variable inertia. right now there is no acceleration, deceleration and i kinda want it to act more like your floating a bit not a whole lot, but a small amount.. and if that amount could be changed by a few simple numbers or even better a variable i would be ecstatic.. however.. the whole math thing is way beyond me anymore and i have no idea where to even start with it
  4. almost forgot... that timer interrupt there you see was my best attempt to stop the game from a CTD if the player were to turn the device on while moving. which i suspected had something to do with the variables changing because it didnt CTD if they were still... so i disable controls for the split second as the thing initialized... and it works, but if there is a better way please enlighten me.. i dont like the weapon being put up which comes on by disable player controls.. although i guess i could just disable movement... but still theres gotta be a better way.

 

 

without further adieu here is the code of which we speak.. and thank you for looking at it with me.

 

 

 

 

  Reveal hidden contents

 

 

in the off chance you're interested in seeing it in action look here there's actually a buncha cools stuff in there this is in no means the focus of the mod.. however important to me.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...