Jump to content

What's new in 0.90


Recommended Posts

Anyone worked out how to add part category icons? This is for resources, agencies and partModules, via the new filter toolbars.

Yes.

There is also PartCategorizer.AddCustomFilter which adds a general category (like the "Filter By Module" and "Filter by Function" categories.

The system already creates buttons for each resource, PartModule, and agency which is also a part manufacturer in any part config. You can however go change their icons as I did.

Link to comment
Share on other sites

So essentially, you need a plugin to change any icons? So a mod that say, added a resource (no plugin) would need to bundle a plugin to give it a proper VAB icon?

Pretty sure, yes. You could try making an icon, dropping it in an "Icons" folder, and try to name it the same way as the resource. I'm not exactly sure how it loads the icons, but if it matches icon name <-> resource name, that might work. Else yes, you'll need a small plugin.

Link to comment
Share on other sites

Hey guys, does anybody happen to know how to access the new epic highlighting stuff? The Part.setHighlight() method only gives the plain old boring highlighter.

Edit: I figured it out:

Part p = ...;

// old highlighter. Not necessary, but looks nice in combination
p.SetHighlightDefault();
p.SetHighlightType(Part.HighlightType.AlwaysOn);
p.SetHighlight(true, false);
p.SetHighlightColor(Color.red);

// New highlighter
HighlightingSystem.Highlighter hl; // From Assembly-CSharp-firstpass.dll
hl = p.FindModelTransform("model").gameObject.AddComponent<HighlightingSystem.Highlighter>();
hl.ConstantOn(XKCDColors.Rust);
hl.SeeThroughOn();

Edited by Kobymaru
Link to comment
Share on other sites

Alright, it looks like SQUAD tightened up the IModuleInfo interface. Now it looks like this is the only way to show a partModule in the partModule list in the Editor tooltip.

This is different from KSP 0.25 where implementing IModuleInfo would show your partModule in the list, but there were also other conditions that would cause it to show.

Notably the partModules in my ActionsEverywhere mod showed in the editor's pop up even though they did not implement IModuleInfo in KSP 0.25, and they are now hidden in KSP 0.90 as they do not implement IModuleInfo.

I don't actually know what condition caused them to be shown in KSP 0.25, but it looks like SQUAD has closed whatever loophole caused them to be shown without the IModuleInfo tag.

D.

Link to comment
Share on other sites

On the first page of this thread, Sarbian mentioned a list of capability checks looking like so:

public int GetPartCountLimit(float editorNormLevel)

public bool UnlockedFuelTransfer(float editorNormLevel)

public bool UnlockedActionGroupsStock(float editorNormLevel)

public bool UnlockedActionGroupsCustom(float editorNormLevel)

public float GetCraftMassLimit(float editorNormLevel)

public Vector3 GetCraftSizeLimit(float editorNormLevel)

public int GetActiveStrategyLimit(float adminNormLevel)

[ .. etc .. ]

I just spent quite a while looking and looking and eventually figured out where the heck these actually are, and what on earth sarbian was talking about with them. I couldn't find them anywhere. I finally found them. I thought I'd share.

They're found under GameVariables.Instance.

So, for example to call GetPartCountLimit for the VAB, it would look like this:

float upgrade_level_VAB = ScenarioUpgradeableFacilities.GetFacilityLevel(SpaceCenterFacility.VehicleAssemblyBuilding);

int part_limit_VAB =
GameVariables.Instance.
GetPartCountLimit
( upgrade_level_VAB );

Link to comment
Share on other sites

Hey guys, does anybody happen to know how to access the new epic highlighting stuff? The Part.setHighlight() method only gives the plain old boring highlighter.

Edit: I figured it out:

Part p = ...;

// old highlighter. Not necessary, but looks nice in combination
p.SetHighlightDefault();
p.SetHighlightType(Part.HighlightType.AlwaysOn);
p.SetHighlight(true, false);
p.SetHighlightColor(Color.red);

// New highlighter
HighlightingSystem.Highlighter hl; // From Assembly-CSharp-firstpass.dll
hl = p.FindModelTransform("model").gameObject.AddComponent<HighlightingSystem.Highlighter>();
hl.ConstantOn(XKCDColors.Rust);
hl.SeeThroughOn();

How would you later remove the highlight? I assume you simply destroy the component you previously added, but I can't seem to figure out the proper syntax to do so.

EDIT This code is working for me to remove it:

Destroy(this.part.FindModelTransform("model").gameObject.GetComponent(typeof(HighlightingSystem.Highlighter)));

One thing I would note on using the new highlighters is remember that it isn't guaranteed to be enabled. The user can turn it off or on in the settings, so probably best to use both the old and new at the same time just in case. For example on my Mac I have to turn it off because it doesn't work properly. Instead of getting a Highlight I get random corrupt textures on the screen instead. This is a bug I guess in 0.90 as it happens with the default stage highlighting as well if the new system is enabled.

Edited by Agathorn
Link to comment
Share on other sites

Has anybody dealt with GameVariables.Instance.UnlockedActionGroupsCustom and GameVariables.Instance.UnlockedActionGroupsStock?

Here's my problem: I want to limit the use of them in kOS depending on whether or not the career has unlocked them... but the problem is that they are unlocked separately for the SPH as for the VAB. So will I have to do it on a per-vessel basis (this vessel was made in the SPH so check it against the SPH's editor level, while THAT one was made in the VAB so check it agaisnt the VAB's editor level)... and that opens up the second question - how on earth do I detect whether a vessel was made in one or the other once it's already been launched ages ago?

Link to comment
Share on other sites

@Steven Mading: I do not believe there is a way to tell from the vessel itself and I don't see anything in the .sfs file that could be used.

For my AGX mod, I simply said that in flight, unlocked action groups is equal to whichever facility (VAB or SPH) is higher level.

You'd have to check the editor.craft files somehow, but the only common thing between a vessel in flight and the editor.craft file is the vessel's name, which can be changed, so I'm not sure it's possible, short of keeping track of it yourself.

D.

Link to comment
Share on other sites

For my AGX mod, I simply said that in flight, unlocked action groups is equal to whichever facility (VAB or SPH) is higher level.

Yeah, we were heading to that conclusion ourselves, but it's good to get confirmation from you that you've hit the same problem. Technically since you can now launch either kind of ship from the runway, there's no real benefit to keeping the two editors' upgrade levels separate and I'm not sure why SQUAD chose to do so.

Link to comment
Share on other sites

Yeah, we were heading to that conclusion ourselves, but it's good to get confirmation from you that you've hit the same problem. Technically since you can now launch either kind of ship from the runway, there's no real benefit to keeping the two editors' upgrade levels separate and I'm not sure why SQUAD chose to do so.

Probably because on the flip side there is no clean way to make a single upgrade either since they ARE distinct buildings.

Link to comment
Share on other sites

Does anybody know how to check if a eva vessel is a engineer, pilot or scientist ?

It seem related to ProtoCrewMember but how can I access to that from the current vessel for exemple ?

Vessel.GetVesselCrew() will give you a list of protocrewmembers for the vessel. feels a bit weird to do that when the vessel is a Kerbal I know, but that should get you there

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...