Mihara

[0.24.2] JSIPartUtilities -- a mishmash of clever things to do with parts.

Recommended Posts

Thanks Art if i may make a comment, if its a dependency for a very good mod that you enjoy playing with ERS for example and makes up a major part of your gameplay then its a bit of a problem, ERS rovers replaced my Bobcat rovers which are always broken hence changing to ERS. However you are correct in the fact that the modder is under no obligation to update or support his mod through continuing changes. I wish there was a step by step guide for recompiling a DLL so i could do stuff myself

Share this post


Link to post
Share on other sites

I think I've got a fix... I'll make a pull request later tonight, but I'm going to ask Mihara to wait on merging it until I get some feedback. It seems to clear the log errors... and the ERS seems to work.

https://www.dropbox.com/s/dhwtxhpaaw0mo1k/JSIPartUtilities.dll?dl=0

The problem seemed to be that now IPartCostModifier must include a .getModuleCost(float). I added:

 float IPartCostModifier.GetModuleCost(float defaultCost)
{
return currentState ? costOfBeingEnabled : 0;
}

to the two places that needed it - componenttoggle and componentgroup.

I assume it replaces:

   public float GetModuleCost ()
{
return currentState ? costOfBeingEnabled : 0;
}

but I just left the old version in the file for now... because I didn't take the time to understand how the plugin works... and having both didn't seem to cause any problems for me. PLEASE give me feedback, because I don't want to pull in bad code to a good project! :)

Art

Edited by artwhaley

Share this post


Link to post
Share on other sites

A small bug report: I noticed some behaviour and I though I would post it here too. When using JSIPartUtilities to toggle nodes on and off in combination with TweakScale, the nodes neatly scale along - until they are turned off and on again. At that point the nodes return on the position from the configuration file and not the ones based on their TweakScale size. With large parts this means the nodes end up inside the part, with small parts it ends some distance away from the part.

I can imagine why this happens, but if it is possible to prevent this it would be rather nice :)

Edited by Camacha

Share this post


Link to post
Share on other sites

Would it be possible to do a three way node toggle with this? So no nodes on the first click, a couple of nodes on the second click and a different set of nodes on the third? After that I imagine it would be reverting back to the first option again.

Share this post


Link to post
Share on other sites

Yes, it looks like it could. I haven't fiddled with the plugin much, but from the documentation... available here : https://github.com/Mihara/PartUtilities/wiki/JSIPartComponentToggle-and-friends

It looks like you'd set up each set of nodes on/off states as a JSIPartComponentGroup

and then add a JSIGroupSelector module to give you the ability to step through the various configurations.

Share this post


Link to post
Share on other sites

I'm, again, talking about things I haven't personally done... so definitely take my advice with a grain of salt... But it looks like you can figure out what you need to know from looking at the cfg files from the A.S.E.T ERS rover.

It APPEARS that you're going to define each state of nodes that should be shown at the same time like this in the part cfg: Assuming you've got nodes named NODEA, NODEB, and NODEC.

MODULE
{
name = JSIPartComponentGroup
groupID = SET1 //name of this configuration, used by the group selector at the end of the file
areComponentsEnabled = false //do the nodes start enabled. Documentation suggests starting with all off with a group selector. No idea if you can start with one on to make a 'default state'.
persistAfterEditor = false //don't need nodes later. If it was a mesh you were toggling... you might need this to be on? Check documentation or experiment
activeInEditor = true //nodes aren't much good if they're not in the editor
activeInFlight = false //nodes aren't much good AFTER the editor either
activeWhenUnfocused = false //nodes REALLY aren't much good when they're on a ship you're not controlling right now!
showEnableDisableOption = false // You need this and the next line true if you want each set to have it's OWN control buttons in the UI, instead of using the group selector at the end of the file.
showToggleOption = false //
managedNodes = NODEA|NODEB //name of the nodes you're turning on in this set
}


MODULE
{
name = JSIPartComponentGroup
groupID = SET2
areComponentsEnabled = false
persistAfterEditor = false
activeInEditor = true
activeInFlight = false
activeWhenUnfocused = false
showEnableDisableOption = false showToggleOption = false
managedNodes = NODEA|NODEC
}


MODULE
{
name = JSIPartComponentGroup
groupID = SET3
areComponentsEnabled = false
persistAfterEditor = false
activeInEditor = true
activeInFlight = false
activeWhenUnfocused = false
showEnableDisableOption = false showToggleOption = false
managedNodes = NODEB|NODEC
}

And then AFTER THOSE THINGS IN THE CFG file (that's important - the file is read in order)

Throw in one of these:

MODULE
{
name = JSIGroupSelector
activeInEditor = true
activeInFlight = false
activeWhenUnfocused = false
groupStateList = SET1,SET2,SET3 //list of sets we defined earlier
nextMenuButton = Next Setup
previousMenuButton = Prev Setup
stateGuiName = Set of Nodes
}

Edited = added comments and code tags

Edited by artwhaley

Share this post


Link to post
Share on other sites

Hello.

I have a small porblem, JSIPartUtilities seem to conflict with TweakableEverything . I no more can attach stuff to the opened sheilded docking port. Is there a way to fix this?

Thanks in advance

Edit: my bad, that was not JSIPartUtilities, it was advancedAnimator. I am trying to put tAset ERS rover under the Endurance lander. Looks Great!

Edited by RedParadize

Share this post


Link to post
Share on other sites
I'm, again, talking about things I haven't personally done... so definitely take my advice with a grain of salt... But it looks like you can figure out what you need to know from looking at the cfg files from the A.S.E.T ERS rover.

It APPEARS that you're going to define each state of nodes that should be shown at the same time like this in the part cfg: Assuming you've got nodes named NODEA, NODEB, and NODEC.

MODULE
{
name = JSIPartComponentGroup
groupID = SET1 //name of this configuration, used by the group selector at the end of the file
areComponentsEnabled = false //do the nodes start enabled. Documentation suggests starting with all off with a group selector. No idea if you can start with one on to make a 'default state'.
persistAfterEditor = false //don't need nodes later. If it was a mesh you were toggling... you might need this to be on? Check documentation or experiment
activeInEditor = true //nodes aren't much good if they're not in the editor
activeInFlight = false //nodes aren't much good AFTER the editor either
activeWhenUnfocused = false //nodes REALLY aren't much good when they're on a ship you're not controlling right now!
showEnableDisableOption = false // You need this and the next line true if you want each set to have it's OWN control buttons in the UI, instead of using the group selector at the end of the file.
showToggleOption = false //
managedNodes = NODEA|NODEB //name of the nodes you're turning on in this set
}


MODULE
{
name = JSIPartComponentGroup
groupID = SET2
areComponentsEnabled = false
persistAfterEditor = false
activeInEditor = true
activeInFlight = false
activeWhenUnfocused = false
showEnableDisableOption = false showToggleOption = false
managedNodes = NODEA|NODEC
}


MODULE
{
name = JSIPartComponentGroup
groupID = SET3
areComponentsEnabled = false
persistAfterEditor = false
activeInEditor = true
activeInFlight = false
activeWhenUnfocused = false
showEnableDisableOption = false showToggleOption = false
managedNodes = NODEB|NODEC
}

And then AFTER THOSE THINGS IN THE CFG file (that's important - the file is read in order)

Throw in one of these:

MODULE
{
name = JSIGroupSelector
activeInEditor = true
activeInFlight = false
activeWhenUnfocused = false
groupStateList = SET1,SET2,SET3 //list of sets we defined earlier
nextMenuButton = Next Setup
previousMenuButton = Prev Setup
stateGuiName = Set of Nodes
}

Edited = added comments and code tags

Ok, this is my first time using this plugin, and modding for ksp, either i did something wrong, or there is a problem inside the plugin itself, i am using it in 0.90 but take a look :

0IkDkCd.png

First of all, the controls for all the groups are showing with eachother, second, i set all the groups to be disabled at start :

MODULE
{
name = JSIPartComponentGroup
groupID = TopButtom
areComponentsEnabled = false
persistAfterEditor = false
activeInEditor = true
activeInFlight = false
activeWhenUnfocused = false
showEnableDisableOption = true
showToggleOption = true
managedNodes = top|bottom
}

MODULE
{
name = JSIPartComponentGroup
groupID = RingOut
areComponentsEnabled = false
persistAfterEditor = false
activeInEditor = true
activeInFlight = false
activeWhenUnfocused = false
showEnableDisableOption = true
showToggleOption = true
managedNodes = 1|2|3|4|8|12|16|20|24|28|32|36|40|44|57|61|65|69|73|77|81|85|89|93
}

MODULE
{
name = JSIPartComponentGroup
groupID = RingIn
areComponentsEnabled = false
persistAfterEditor = false
activeInEditor = true
activeInFlight = false
activeWhenUnfocused = false
showEnableDisableOption = true
showToggleOption = true
managedNodes = 5|9|13|17|21|25|29|33|37|41|45|48|51|54|58|62|66|70|74|78|82|86|90|94
}

MODULE
{
name = JSIPartComponentGroup
groupID = RingTop
areComponentsEnabled = false
persistAfterEditor = false
activeInEditor = true
activeInFlight = false
activeWhenUnfocused = false
showEnableDisableOption = true
showToggleOption = true
managedNodes = 6|10|14|18|22|26|30|34|38|42|46|49|52|55|59|63|67|71|75|79|83|87|91|95
}

MODULE
{
name = JSIPartComponentGroup
groupID = RingBottom
areComponentsEnabled = false
persistAfterEditor = false
activeInEditor = true
activeInFlight = false
activeWhenUnfocused = false
showEnableDisableOption = true
showToggleOption = true
managedNodes = 7|11|15|19|23|27|31|35|39|43|47|50|53|56|60|64|68|72|76|80|84|88|92|96
}

MODULE
{
name = JSIGroupSelector
activeInEditor = true
activeInFlight = false
activeWhenUnfocused = false
groupStateList = TopButtom,RingOut,RingIn,RingTop,RingBottom
nextMenuButton = Next Setup
previousMenuButton = Prev Setup
stateGuiName = Nodes
}

but as you see, the text for the disable / enable differs between groups, also, some nodes show up at the creation of the part, also, the disable/enable text is working reverse of the group, meaning, when i want the nodes to be disabled, i see enable component group text, and vice versa. how can i fix these problems?

Share this post


Link to post
Share on other sites

Ok, got it working :

1- Used enableMenuString, disableMenuString, and toggleMenuString to make proper words to fix my confusion, so that was not a bug

2- but here is the bug, if i have the last module in the code (look bellow), the plugin don't respect my settings for the very first node (false, or true, both cases the component starts as false), but as soon as i comment that part, things work, not sure what did i do wrong there or is it a bug in the code itself. also, still if i have this module in, all the groups show at once.

MODULE
{
name = JSIGroupSelector
activeInEditor = true
activeInFlight = false
activeWhenUnfocused = false
groupStateList = TopButtom,RingOut,RingIn,RingTop,RingBottom
nextMenuButton = Next Setup
previousMenuButton = Prev Setup
stateGuiName = Nodes
}

Share this post


Link to post
Share on other sites
Compiled a version for Kerbal 1.0.2. Some minor changes in source (included). License is GPLv3. NO warranty's!

https://www.dropbox.com/s/z8pdcjp3vg4xz5i/JSIPartUtilities.zip?dl=0

I installed this 1.02 version of JSIPartUtilities but the ASET ERS Rover's wheels are now sinking into the ground at launch and refusing to budge. The previous version of JSIPartUtilities didn't do this but it didn't let me toggle the suspension or change nodes.

Share this post


Link to post
Share on other sites

And bad things happen if you use a part with ModuleAnimateGeneric on it screenshot2.pngscreenshot3.png

Share this post


Link to post
Share on other sites

KSP starts rendering text to represent audio events? yeah, I hear you... that's pretty nasty. But kinda cool too...

Share this post


Link to post
Share on other sites

hey guys, I've recompiled this plugin for 1.1.2 since it is needed for one of my mod. Then my kind question to whoever is currently maintaining this plugin, can I attach recompiled version of this plugin to my mod (MFS), of course with credits, license and link information.

Temporary download if someone is interested:

https://www.dropbox.com/s/akiryp62w3glvpq/JSIpartUtilities1.1.2.zip?dl=0

Cheers,

Rio

Edited by riocrokite

Share this post


Link to post
Share on other sites

I really wish someone would do something like this specifically for attach nodes combined with tweak scale mod, it's a long time i wished this and never got it granted :(

Share this post


Link to post
Share on other sites
On 14 November 2016 at 5:59 AM, MeCripp said:

I know your really busy but is there anyway you can fix this :(@JPLRepo

It's not about whether I can fix it. It's about having the time. Which I don't unfortunately.

Edited by JPLRepo

Share this post


Link to post
Share on other sites
5 hours ago, Deimos Rast said:

Why not ping @riocrokite, the person who recompiled it last time?

yah, I've tried to recompile it some time ago but couldn't resolve all the errors, sorry :(

Share this post


Link to post
Share on other sites
17 hours ago, riocrokite said:

yah, I've tried to recompile it some time ago but couldn't resolve all the errors, sorry :(

O Now this is bad news ;.;

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.