linuxgurugamer / FTLDriveContinued

Other
4 stars 4 forks source link

Beta 3, fixes two bugs #17

Closed arekbulski closed 6 years ago

arekbulski commented 6 years ago

I think I fixed the 2 bugs but cannot test it atm.

arekbulski commented 6 years ago

I asked you earlier about OnLoad OnStart and you provided me with a link. I have to tell you, we need a better source of info about this. On the forum, that guy pretty much had no idea when these methods are called and he looked into it throughly.

linuxgurugamer commented 6 years ago

I'll hold off on merging until you let me know

arekbulski commented 6 years ago

2 commits, I am done, ready for your testing.

Note that code is faster but is based on assumption: that OnLoad is called on every vessel switch, docking, undocking, etc. I would like you to test that. Secondly, I lowered the exponential curve so its not so hard on players trying to build large. This commit is kind of optional. Changelog updated there too.

linuxgurugamer commented 6 years ago

I'm going to merge, but I'm reverting the change of the exponential curve back to 1.4, and the max drives back to 35

linuxgurugamer commented 6 years ago

There are some problems, I'm working on fixing them, will get it updated on Github tomorrow night.

Also, I told you about the Editor needing to use ProtoVessel, I saw your comment about the ActiveVessel not being used in editor mode.

You made a mistake when you changed the FixedUpdate to Update, it totally messed up the animation speed.

I changed the OnStart back to Start, simplifies the code a bit. I moved the calculations of the totalGeneratedforce, totalChargeRate an, totalChargeCapacity and totalChargeTime into a separate function, see the next comment: Finally, there is no need to recalculate the values every time the vessel is loaded. I make it calculate the values at the Start(), and then I added an event callback for when the vessel is modified. If the vessel isn't modified, the values won't change, so no need to recalculate them.

One functional change I made is to allow the drives to keep spinning if you switch vessels.

I may be able to upload my changes tomorrow morning, I'll post another note here when I've done so.

linuxgurugamer commented 6 years ago

Ok, I've finished and pushed my changes. I reconsidered my decision to change the drive exponent, so while it's defaulting to 1.4, I've added a settings page to allow several things to be customized. This was partly done to provide the ability to have it work the same as before.

There is now a window in the editor, which shows all the available beacons with a slider to allow the player to see what the different results would be for different orbital altitudes around different bodies.

FixedUpdate changed back to Update OnStart changed back to Start Calculations of the totalGeneratedforce, totalChargeRate an, totalChargeCapacity and totalChargeTime into a separate function Added back visual message when jump not possible Implemented code to hide Jump button when drive not spinning Added context info in editor Source body is changable by clicking the left/right arrows Starting orbit is configurable with slider, going from just above the atmosphere to the edge of the SOI Added "x" to allow the window to be closed Changed FindAllSourceDrives to function, so it can be used both in Editor and in Flight Added settings window driveStopsUponVesselSwitch autoJump = false multipleDriveExponent = 1.4f Hide the Execute Jump button after a jump is executed Removed double debug.log line in LogsManager Added code to save window position, both in Editor and in Flight (separate values)

linuxgurugamer commented 6 years ago

One thing I'd like to do is to get all the calculations into a single function. Right now they are in three different places. This shouldn't hold up a release, if you don't have any significant changes and don't see any bugs, I'll try to get this released tomorrow afternoon.