Jump to content

[1.2] TweakableEverything 1.16-beta - For all your part tweaking needs


toadicus

Recommended Posts

It is not really a big issue, I am just reporting all exceptions that I find to all mod authors as NPE's (NRE's in .NET parlance? I am a C++/Java dev by trade) tends to indicate a bug and even if it only happens once it can still have lasting effects, thus I am quite allergic to exceptions as I believe all developers should be. :-)

Lol.

Anyways, I tend to as well, though sometimes some are minor ones which can't be done much about.

Was just adding in my input since I had spotted this and just sort of shrugged it off, or forgot about it, until you mentioned it.

For you though, does that exception (I'm using exception detector, which actually doesn't detect ALL exceptions, I actually found one from karbonite that was spamming the log while looking at the log for this one) only happen with certain parts? For me, I've only seen it happen with those two parts.

Link to comment
Share on other sites

Hey toadicus, I've got a couple of things to report.

First of all, TweakableDecouplers seems to work just fine with ModuleAnimatedDecoupler and ModuleAnimatedAnchoredDecoupler (from AnimatedDecouplers, useful for letting decoupler fairings provide aerodynamic shielding), after I defined a config similar to the two "stock" patches to do the application:


@PART
[*]:HAS[@MODULE[ModuleAnimatedDecoupler]]:FOR[TweakableEverything]:NEEDS[TweakableStaging]
{
MODULE
{
name = ModuleTweakableDecouple
decouplerModuleName = ModuleAnimatedDecoupler
}
}

@PART
[*]:HAS[@MODULE[ModuleAnimatedAnchoredDecoupler]]:FOR[TweakableEverything]:NEEDS[TweakableStaging]
{
MODULE
{
name = ModuleTweakableDecouple
decouplerModuleName = ModuleAnimatedAnchoredDecoupler
}

MODULE
{
name = ModuleTweakableCrossFeed
fuelCrossFeed = false
}
}

However, I noticed during testing that if I ever disabled all of the decouplers on a ship at the same time (and had no engines or parachutes or anything else stageable), when I re-enabled staging, the staging order would not regenerate unless I added a new stageable thing.

Link to comment
Share on other sites

By the way, is it just me, or did the latest version of TE bork the ladders? For the last week or two, when I set the ladders to closed, or 'undeployed', in the editor, they're extended when I launch the ship, and vise-versa. Just thought I'd mention...

:D

Link to comment
Share on other sites

OvermindDL1 and smjjames, thanks. I'm guessing it's a "late start" issue, where something that LateUpdate (which usually only runs after start) hasn't finished starting yet, which happens sometimes in heavily-modded installs. It might also be that the NovaPunch parts are using ModuleJettison in a way that Squad does not, and I'm not anticipating. I'll try to dig in to that this weekend.

Kerbas_ad_astra, thanks for the patch! I'll look in to the "nothing's in staging" issue; I have a guess as to what's going on.

Neutrinovore, I vaguely remember something about ladder animations being backwards back when I first wrote TweakableAnimateGeneric. Maybe I un-backwardsed it in the 1.11 release when I rewrote the animation stuff. I'll look in to that as well.

In general regarding TweakableStaging: I'm going to try a couple of things to maintain "smart" staging behaviour that adds stages for disabled parts that have "fallen off" the bottom of the list as you've worked when you re-enable them, without adding stages when we don't need them. If it doesn't work, though, I'm going to just stick them on the bottom and you'll have to re-sort things yourself.

Link to comment
Share on other sites

Update:

TweakableJettison is "fixed", in that it now protects itself more aggressively against inconsistently-configured parts. Those two NovaPunch parts, for example, have ModuleJettison modules, which claim we'll find a jettison fairing transform in the part model called "fairing", but no such fairing exists in the part model. That's not something I can change; the fix on my end is to disable TweakableJettison when I find cases like it.

TweakableLadders is fixed, and is no longer backwards in the editor.

Hopefully another weekend update if I can get a chance to look at TweakableStaging before then. :)

Link to comment
Share on other sites

Cross-posting, cause this thread has the brains to do it :-P

I find that I lack some functionality that would fit great with Smart Parts.

The thing is, I need to be able to throttle particular engines on particular fuel %, as well as particular altitude.

That is, if some means existed to bind throttle limiting to action groups, I'd just used existing SmartParts fuel sensor and/or altimeter with that, but...

Somebody needs to write a plugin to add various throttle levels (say, every 5% up to 35%, then every 10% up to 75%, then every 5% again to 100%) to action groups. Anyone?

Link to comment
Share on other sites

Cross-posting, cause this thread has the brains to do it :-P

I find that I lack some functionality that would fit great with Smart Parts.

The thing is, I need to be able to throttle particular engines on particular fuel %, as well as particular altitude.

That is, if some means existed to bind throttle limiting to action groups, I'd just used existing SmartParts fuel sensor and/or altimeter with that, but...

Somebody needs to write a plugin to add various throttle levels (say, every 5% up to 35%, then every 10% up to 75%, then every 5% again to 100%) to action groups. Anyone?

This sounds like a job for KOS scripting.

Link to comment
Share on other sites

That might also be something that Throttle Controlled Avionics (Continued) could help you with, depending on just what you're trying to do.

In terms of a really simple addon that does nothing but add action group entires for throttle control... that is something I could write, and I could make it dynamic so there wouldn't need to be 20 action group entries per engine; you could essentially set the thrust limiter, click "convert thrust limit to action group" or something like that, and -- hey presto -- new action group in the menu.

If that's something in which there is broad interest, I could potentially be persuaded to make a modlet for it.

Link to comment
Share on other sites

Hello toadicus! First of I want to thank you for this magnificent mod that I've been playing with since the first release. Thx a lot! :)

Last month or so I've been working on shuttle design and RSC balancing is killing me now... :D So I came here with an idea of maybe one more super handy module for your tweakables.

As you may know, there is a mod called ModuleRCSFX and it allows per axis restriction of RCS thrust via config. So the idea is to make (if it's possible of course) something similar but on the fly right in the game for each RCS thruster where we need it. I don't know is it possible to restrict individual thruster in the multivectored RCS cluster part but at least for linear RCS it would be already a HUGE help for balancing that complicated asymmetrical crafts.

So, how this looks to me. Let's say I have a linear RCS thruster pointed in a weird direction. And I need it to work only in a certain situation, for example I need it to work on Translate Left, on Pitch Up and that's it. In other cases it will spin my craft in unpredictable manner. For that I get to tweak menu and uncheck all not needed directions except Translate Left and on Pitch Up and voilà!

Actually just for linear RCS no need to be 6 translate and 6 rotate options. Translate Horizontally (X axis), Translate Vertically (Y axis), Translate Back&Forth (Z axis) and Pitch, Yaw, Roll must be enough. And of course this need to respect mirroring.

I hope to see something similar in game one day. :cool:

Link to comment
Share on other sites

add action group entires for throttle control... that is something I could write, and I could make it dynamic so there wouldn't need to be 20 action group entries per engine; you could essentially set the thrust limiter, click "convert thrust limit to action group" or something like that, and -- hey presto -- new action group in the menu.
Yes, that's it, do so please when You'll have spare time. TIA.

I do not want to learn kOS just yet, because I know for sure that I'll be addicted. Already addicted to KSP w/o kOS - and consider it as easier form of disease with less potential of reduction of life quality.

- - - Updated - - -

I think I found a bug.

I can not open menu of PF Interstage adapter anymore (after last update of TweakableEverything). Prior to last update, menu was horribly slow, but worked. Lags in said menu were like ten to thirty seconds before fairing actually changed, but nevertheless it was painful but useable. Not anymore.

The part in ModuleManager.cache differs by this:

--- without-te  2015-06-14 01:44:31.958304000 +0300
+++ with-te 2015-06-14 01:49:39.304883200 +0300
@@ -112,6 +112,18 @@
MODULE
{
+ name = ModuleTweakableDecouple
+ decouplerModuleName = ModuleDecouple
+ }
+ MODULE
+ {
+ name = ModuleStagingToggle
+ defaultDisabled = false
+ activeInFlight = true
+ activeInEditor = true
+ }

The logs (with TE enabled) are here, tell me if You need them with TE disabled.

- - - Updated - - -

I think the root of the problem might be the fact that KzInterstageAdapter2 has one node that acts like zero-force decoupler. Anyway it manifests itself like so:

ArgumentException: Illegal prefix
Parameter name: pfx
at KSPAPIExtensions.MathUtils.PrefixString (SIPrefix pfx) [0x00000] in <filename unknown>:0
at KSPAPIExtensions.MathUtils.FormatSI (SIPrefix pfx, Double value, Int32 sigFigs, Int32 exponent, System.String unit) [0x00000] in <filename unknown>:0
at KSPAPIExtensions.MathUtils.ToStringSI (Double value, Int32 sigFigs, Int32 exponent, System.String unit) [0x00000] in <filename unknown>:0
at KSPAPIExtensions.MathUtils.ToStringExt (Double value, System.String format) [0x00000] in <filename unknown>:0
at KSPAPIExtensions.MathUtils.ToStringExt (Single value, System.String format) [0x00000] in <filename unknown>:0
at KSPAPIExtensions.UIPartActionFloatEdit.UpdateValueDisplay (Single newValue) [0x00000] in <filename unknown>:0
at KSPAPIExtensions.UIPartActionFloatEdit.UpdateItem () [0x00000] in <filename unknown>:0
at UIPartActionWindow.CreatePartList (Boolean clearFirst) [0x00000] in <filename unknown>:0
at UIPartActionWindow.Setup (.Part part, DisplayType type, UI_Scene scene) [0x00000] in <filename unknown>:0
at UIPartActionController.CreatePartUI (.Part part, DisplayType type, UI_Scene scene) [0x00000] in <filename unknown>:0
at UIPartActionController.SelectPart (.Part part, Boolean allowMultiple) [0x00000] in <filename unknown>:0
at UIPartActionController.HandleMouseClick (UnityEngine.Camera cam, Boolean allowMultiple) [0x00000] in <filename unknown>:0
at UIPartActionController+.MoveNext () [0x00000] in <filename unknown>:0

...when I first click the part with mouse2.

- - - Updated - - -

The crude workaround is this diff:

$ diff -u0N TweakableDecouplers.cfg.orig TweakableDecouplers.cfg
--- TweakableDecouplers.cfg.orig 2015-01-03 19:35:50.000000000 +0200
+++ TweakableDecouplers.cfg 2015-06-14 02:17:19.781857000 +0300
@@ -32 +32 @@
-@PART
[*]:HAS[@MODULE[ModuleDecouple]]:FOR[TweakableEverything]:NEEDS[TweakableStaging]
+@PART
[*]:HAS[@MODULE[ModuleDecouple]]:FOR[TweakableEverything]:NEEDS[TweakableStaging]:HAS[!#name=KzInterstageAdapter2]
@@ -56 +56 @@
-@PART
[*]:HAS[@MODULE[ModuleTweakableDecouple]]:AFTER[TweakableEverything]:NEEDS[TweakableStaging]
+@PART
[*]:HAS[@MODULE[ModuleTweakableDecouple]]:AFTER[TweakableEverything]:NEEDS[TweakableStaging]:HAS[!#name=KzInterstageAdapter2]

Link to comment
Share on other sites

cipherpunks, that's an issue with KSPAPIExtensions not liking FloatEdits that equal 0, I believe, which has been reported before. A few people have posted workarounds; here's mine:

@PART[*]:HAS[@MODULE[ModuleTweakableDecouple]&@MODULE[ModuleDecouple]:HAS[#ejectionForce[0]]]:AFTER[TweakableEverything]
{
@MODULE[ModuleDecouple]
{
@ejectionForce = 1
}
}

@PART[*]:HAS[@MODULE[ModuleTweakableDecouple]&@MODULE[ModuleAnchoredDecoupler]:HAS[#ejectionForce[0]]]:AFTER[TweakableEverything]
{
@MODULE[ModuleAnchoredDecoupler]
{
@ejectionForce = 1
}
}

This should bring their ejection force up to 1 kN, which should not cause that issue.

I'm hopeful that KSPAPIExtensions will not be necessary after Squad releases 1.0.3.

Link to comment
Share on other sites

Alright my faithful TweakableStaging testers; here's a dev build:

[zip] [tar.gz] [tar.xz]

This contains the fixes for ladders and engine fairings I mentioned the other day, and has even more revisions to the logic behind TweakableStaging. I messed around with it for a while this morning and couldn't get it to magically produce extra stages, and in general it felt pretty natural during the build process. Also, it should recognize staging-enabled docking nodes as decouplers now, which might help with building complex craft around decoupling docking nodes.

Link to comment
Share on other sites

I'm running into a whole bunch of exception spam when I load up some ships in the VAB. Theres also a bunch of text on the right side when I load up the VAB.

Output log of it: http://sta.sh/01972t0ph3s5

Screenshots of the ships that it was happening with, there might have been another one or two that I didn't screenshot:

Javascript is disabled. View full album

I narrowed it down when I deconstructed one of those ships to find the trigger, then reproduced in pure stock with just Tweakable Everything.

Text that appears when I take a docking port out of partlist:

screenshot22_zpsm3f0mmik.png

Error starts when I place the docking port on anything.

screenshot23_zps62ti87id.png

Text that shows when I remove it:

screenshot24_zpsyyhy8c4y.png

Edited by smjjames
Link to comment
Share on other sites

screenshot6_500.jpgi.gif

...and it "hangs" in this state. Seems to be triggered by hovering on any part.

Logs

Latest dev build ofc.

Edit: more stuff, also with FASA parts (white text from stager again "hangs" there):

screenshot7_500.jpgi.gif

Logs2

BTW the doors on SM are open in editor when I 1st place the part, and have to be closed, but I guess that's normal for that part? No?

Edited by cipherpunks
add
Link to comment
Share on other sites

http://i.piccy.info/i9/ae2fb2b870829f2049b26d4065ce35cc/1434507873/36955/917625/screenshot6_500.jpghttp://i.piccy.info/a3/2015-06-17-02-24/i9-8358111/500x313-r/i.gif

...and it "hangs" in this state. Seems to be triggered by hovering on any part.

Logs

Latest dev build ofc.

Edit: more stuff, also with FASA parts (white text from stager again "hangs" there):

http://i.piccy.info/i9/831cd92ba1865c33ead8b383641729eb/1434510664/38287/917625/screenshot7_500.jpghttp://i.piccy.info/a3/2015-06-17-03-11/i9-8358128/500x313-r/i.gif

Logs2

BTW the doors on SM are open in editor when I 1st place the part, and have to be closed, but I guess that's normal for that part? No?

is that a cargo bay? I believe it's normal for them to be open when you first place it.

I've reverted to the previous dev build since my previous post because it kept error spamming with docking ports and the long text that sticks out into the middle of the screen was annoying.

Link to comment
Share on other sites

smjjames, I'm guessing your exceptions are the result of not using the ToadicusTools bundled with the dev build. I can't be sure of that, because I haven't tested things that way, but it makes sense to me.

The words on your screen are just debug code I left compiled in. I noticed that when I played last night; sorry for the noise. ;)

cipherpunks, are you saying that staging hung up every time you hovered over an icon in the list in the first case? Can you elaborate a bit on the steps you took that led to that behavior?

Also, what is the part in your staging list with the "+" looking

In the second case, I see everything working fine a lot, but then sometimes something null winds up in the staging list. I'll look in to that.

*edit*: For clarity, when you say "it 'hangs' here", do you mean KSP freezes, or do you mean the staging list gets stuck?

*edit2*: In general, please provide as much detail as you can about what you were doing that led to any troubles. I played with this build (more or less) for a few hours and built a big station module launcher and staging never did anything funky the whole time, so I need to know what I need to do to reproduce your steps.

Also cipherpunks, I see that you've got a patch that adds ModuleStagingToggle to engines; are you adding it to anything else? Seeing any custom patches for ModuleStagingToggle may be useful. Further, can if you remove those special patches can you reproduce your issue?

Edited by toadicus
Link to comment
Share on other sites

smjjames, I'm guessing your exceptions are the result of not using the ToadicusTools bundled with the dev build. I can't be sure of that, because I haven't tested things that way, but it makes sense to me.

The words on your screen are just debug code I left compiled in. I noticed that when I played last night; sorry for the noise. ;)

I swear I did, I'll take another look.

I reproduced the same results by using a stock branchoff and moving the folders from your dev build download into the gamedata in that branchoff.

Edit: I do have MM 2.6.5, but I've been using that since it was released.

Proof:

Untitled_zpsuy8y172g.png

Edited by smjjames
Link to comment
Share on other sites

smjjames, I'm not sure what happened with the archive you got, but something was wrong in the ToadicusTools packaged therein. Here's a new version that is not wrong:

[zip] [tar.gz] [tar.xz]

It also has the debug messages no longer printing to the screen. They still go to your log, to help me debug.

As always, please provide as much info about reproducing problems as possible, and whenever possible try to duplicate problems with simple assemblies of stock parts -- it really speeds things up for me, and therefore gets fixes to you faster. If a problem ONLY occurs with a mod part, identify that part specifically and again try to reproduce it with the smallest possible assembly. If "smallest possible" is still pretty big, consider sharing the craft file on KerbalX so I can isolate the mods and parts I need.

Thanks guys. :)

Link to comment
Share on other sites

OK, I think I might have figured out what cipherpunks meant. The build I put up last week introduced a bug where if you had a disabled part and no stages in the list, you couldn't re-enable it unless you added another stageable part to the ship first. I've fixed that. I've also stopped using Squad's "ScheduleSort" method which delays the sort until later, because that was causing occasional exceptions when parts got yanked off the ship right after being put on (for example). I've also found and fixed a bug I uncovered where disabled parts would make enabled symmetry partners.

New dev build with less noise in the log (but hopefully enough to be useful) and the fixes above: [zip] [tar.gz] [tar.xz]

Link to comment
Share on other sites

Bug confirmation: stager tries to update perpettually, part is stuck not in the staging.

Steps to reproduce:

- install latest dev build

- install latest FASA, start KSP 1.0.2

- place Gemini pod

- place Gemini RCS on top

- place Gemini Docking Nosecone Fairing (messages start to appear at bottom right)

- optionally place Gemini Docking Cap

Expected result: every part decoupler gets added to staging

Actual result: one decoupler is stuck left of staging queue, dev messages in bottom right corner keep repeating (restaging perpettually)

screenshot5_500.jpgi.gif

screenshot8_500.jpgi.gif

Logs, packed 2 screns

Edited by cipherpunks
add pic
Link to comment
Share on other sites

cipherpunks, which version were you using? That doesn't look like the latest dev build (which iirc shouldn't have any screen text). I'll try to test with FASA soon.

tg626, none of the modules should be touching the staging list unless you're toggling staging on and off with TweakableStaging. Can you describe what you're doing when the stages are "juggled"?

I've half a mind to completely rewrite TweakableStaging; it's starting to damage my calm.

Link to comment
Share on other sites

cipherpunks, which version were you using? That doesn't look like the latest dev build (which iirc shouldn't have any screen text).
My bad - screenhots were made prior to update from previous dev build to latest dev build, but the problem is all the same it seems. Should have menthined that, but see below in bolditalic. To repeat, in very latest version all is absolutely the same, just no text - that decoupler keeps blinking, e.g. adding to the bottom of staging, and being removed to the left again, and in logs I see:
FASAGeminiNoseCone2 (TweakableEverything.ModuleStagingToggle): Time to update, stagingEnabled=False, isInStagingList=False
This module queued a staging event last update; sorting now.
LateUpdate done.


(Filename: C:/buildslave/unity/build/artifacts/StandalonePlayerGenerated/UnityEngineDebug.cpp Line: 56)

FASAGeminiNoseCone2 (TweakableEverything.ModuleStagingToggle): Time to update, stagingEnabled=True, isInStagingList=False
Staging state changed.
stagingEnable: True
part.stackIcon.iconImage: DECOUPLER_VERT
part.isInStagingList: False
Our icon was already not in staging, so not assigning a new inverseStage.
...doStageAssignment: False
Switching staging to enabled, default new inverseStage=1
Creating our staging icon in the staging list.
No other module has queued a staging sort this update; queueing now.
Staging switch done
LateUpdate done.

..repeating. Can't really screenshot that - need to install FRAPS or something to do some video, but hope You got a grip, no?

- - - Updated - - -

I've half a mind to completely rewrite TweakableStaging; it's starting to damage my calm.
IME most russian programmers tend to do that really often - to the point that it's amlost their motto :-) Worked with mostly good ones, though. Out of curiosity: can this imply that their calmness is too fragile? Edited by cipherpunks
clarify
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...