Jump to content

[1.0.4] KSPAPIExtensions V1.7.5 - Utilities for shared mod use 25 Jun


swamp_ig

Recommended Posts

Thanks, taniwha.

I don't have SmartParts installed, but I did find that my problem went away when I uninstalled TweakableEverything and also comes back when I re-install it. So far, that's looking like the trouble mod.

Thanks for taking a look for me. Keep being awesome! :D

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...
On 11/10/2015, 4:42:11, taniwha said:

KSPAPIExt seems to work just fine with KSP 1.0.5, so I'll leave it alone pending any reports.

I hate to be the bearer of bad news on that note. The latest release breaks real fuels GUI which makes it impossible to load tanks up and config engines to use fuels. The exception thrown here in the console is 

[Log]: System.NullReferenceException: Object reference not set to an instance of an object
  at KSPAPIExtensions.UIPartActionChooseOption.UpdateItem () [0x00000] in <filename unknown>:0

This shows up immediately when trying to click the little GUI button to "remove tanks" Of course the tanks dont remove. This is repeatable on multiple installs ive done including a pure stock install with only Real Fuels and your extension. Hope there is going to be an update soon.

 

Link to comment
Share on other sites

  • 3 months later...
4 hours ago, NathanKell said:

@e-dog no, because @taniwha is putting the relevant bits in 1.1 itself. :) Also, great to see you!

Oh, so will I be able to use stock UI_FloatEdit?

I'll look into what's already in KSP pre-release on the weekend then.

Link to comment
Share on other sites

UI_FloatEdit, UI_ScaleEdit and UI_ChooseOption are all stock now. They still have some polishing that needs to be done, but should work well enough for testing. There is even an SI formatter, but it is likely to change soon, so I won't give its details.

Part messaging will not be "ported", but I have a solution using KSPEvent. I'll post details once I get MFT up to snuff (thus getting the chance to test it).

To put it simply, the Unity update in 0.24 killed the whole reason for KAE by forcing everyone to have the same version, so maintaining KAE became a horrid chore, thus... }:>

Link to comment
Share on other sites

What is KSPEvent using under the hood?  My understanding is that PartMessage was made to avoid the crappy Unity SendMessage system.  Which I can certainly understand.  Is KSPEvent using the new UnityEvents system?

Link to comment
Share on other sites

On 4/1/2016 at 2:15 AM, taniwha said:

UI_FloatEdit, UI_ScaleEdit and UI_ChooseOption are all stock now. They still have some polishing that needs to be done, but should work well enough for testing. There is even an SI formatter, but it is likely to change soon, so I won't give its details.

Part messaging will not be "ported", but I have a solution using KSPEvent. I'll post details once I get MFT up to snuff (thus getting the chance to test it).

To put it simply, the Unity update in 0.24 killed the whole reason for KAE by forcing everyone to have the same version, so maintaining KAE became a horrid chore, thus... }:>

Gigablagoooaparhageeeeee (begins to drool) super awesomeness!

Link to comment
Share on other sites

I have just been trying something that uses this. I have just Tweakscale and Hangar that come with the DLL, and Hangar is old enough that it had to have its own version, not the more recent version with Tweakscale. If I read things correctly, that's expected behaviour, depends which version of plug-in the Mod is compiled against. Is it possible to have a plug-in that, in the transition, just translates between the plugin and the official KSP version? Or do I misunderstand how the linking works? Though one possible old Mod giving a problem is hardly a disaster.

I am a little anxious about making the switch to v1.1 but KSP isn't a huge problem to have multiple independent copies of. It's more a feeling that there are going to be some 1.1test versions of Mods lurking in the shadows, all labelled as 1.1-compatible, and they might not be compatible with the release version. I probably worry too much, but this is about rocket science, after all.

(Mods such as Hangar, there are all sorts of ways of getting a rover down onto another world, but there is room for black-boxing the detailed design, just as we don't worry about the fine details of turbopumps.)

Link to comment
Share on other sites

This "mod" is declared dead. The primary feature most mods actually wanted from it (the tweakable controllers) is now stock, and even the SI formatting is stock. The only fairly major thing remaining (part messaging) is better done using stock features that were always there (ModularFuelTanks has some sample code for what I have in mind).

Link to comment
Share on other sites

  • 2 weeks later...

@taniwha when I take some existing code that was using KSPAPIExtensions and remove the "using KSPAPIExtensions" line and recompile, Xamarin complains that UI_ChooseOption doesn't exist and asks if I'm missing a reference.  Grepping the assembly-csharp dll from the command line I can see that it's in there.   I've got the assembly-csharp DLL as a reference and I'm targeting .NET 3.5.  Any ideas what I could be doing wrong?  Does existing code need to be modified in some way to work in 1.1?  Do I need a different "using" line?

(I gave up in frustration last night so don't have the exact error; I can provide more info tonight now that I'm calmed down lol)

Link to comment
Share on other sites

9 hours ago, sarbian said:

@hab136 it works fine here. Are you sure you do not have a hard path in your reference that point to an 1.0.5 dll ?

As it turns out there's an evil DLL and a good DLL:

$ find KSP.app -name Assembly-CSharp.dll -exec md5 "{}" \;
MD5 (KSP.app/Contents/Data/Managed/Assembly-CSharp.dll) = c7d146b21966fd85b6e308da77d23076
MD5 (KSP.app/Contents/Resources/Data/Managed/Assembly-CSharp.dll) = 8a7acb596daf1a850163a083263d0ced

I don't know why there's two Assembly-CSharp.dll files, but I managed to use the wrong one.  Switching to the right one fixed it.  Mystery solved!

Edited by hab136
Link to comment
Share on other sites

  • 2 months later...

So, in an attempt to revive an old mod that used KAE, and now seeing this is a dead mod with parts having been incorporated, or to be incorporated into 1.1...

Would it be possible to get some guidance on how to fix the below errors that popped up when removing the KSPAPI reference?

[PartMessageListener(typeof(PartVolumeChanged), scenes: ~GameSceneFilter.Flight)]

[PartMessageDelegate(isAbstract: true)]

public delegate void AirshipDrainSelected([UseLatest] string displayName);

[PartMessageEvent]

[PartMessageListener(typeof(AirshipDrainSelected), scenes:GameSceneFilter.Flight, relations:PartRelationship.Self)]

PartMessageService.Register(this);

envelopeVolumeNetUI = envelopeVolumeNet.ToStringExt("F3") + "m³";

Link to comment
Share on other sites

Ok then.  Thanks.

I now understand why the creator of this mod never updated it... and why I know I'm right in professing, don't let your plugin become so dependent on others that you can't easily divorce yourself of them.

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...