AlphaAsh

[1.1.2] Kerbal Konstructs v0.9.7.1 - Slopey Glidey

Recommended Posts

Hmm. If the default recovery factor is 50%, that means that it's no longer economical to fly a plane to anywhere besides KSC, which removes one of the main attractions for airports.

Share this post


Link to post
Share on other sites
Hmm. If the default recovery factor is 50%, that means that it's no longer economical to fly a plane to anywhere besides KSC, which removes one of the main attractions for airports.

Not necessarily. If the base is a lot closer to you than KSC, you can still make more back from recovery. You can't always make a landing at KSC. Further it's a default - bases can be configured to have a greater recovery factor. And finally recovery factor is still 100% if in the effective range of a base.

"...and the recovery takes place beyond the effective range of the base."

Share this post


Link to post
Share on other sites

How to Configure a Launchsite With LaunchRefund and Recovery Ratings

Example config:

STATIC
{
name = kkrunway2
mesh = kkrunway2.mu
module = Part
category = Runways
author = AlphaAsh
static = true
cost = 60000
title = Runway
manufacturer = KashCorp
description = Planes crash on it.
DefaultLaunchPadTransform = kkrunway2_spawn
DefaultLaunchSiteWidth = 45.0
DefaultLaunchSiteLength = 1700.0
Instances
{
CelestialBody = Kerbin
RadialPosition = -97641.95,-62825.11,589689
Orientation = 0,1,0
RadiusOffset = 1239
RotationAngle = 268
RefLatitude = -6.00022612550579
RefLongitude = 99.4018532257957
VisibilityRange = 25000
Group = RoundRange
LaunchSiteName = Round Range Runway
LaunchPadTransform = kkrunway2_spawn
LaunchSiteDescription = No description available
LaunchSiteType = SPH
LaunchSiteLogo = roundrangerunway
Category = Runway
OpenCost = 25000
CloseValue = 5000
OpenCloseState = Open
CustomInstance = False
[B] LaunchRefund = 10
RecoveryFactor = 80
RecoveryRange = 100000[/B]
}
}

See the three bolded parameters in the Instance. That's all there is to it. LaunchRefund and RecoveryFactor are percentages. RecoveryRange is in meters.

You can set them in the Launchsite Editor in the game instead.

Edited by AlphaAsh

Share this post


Link to post
Share on other sites

I've noticed a strange issue where base map icons (in my case for KerbinSide, but I'd imagine this would happen with other, non-KerbinSide KK bases as well) are appearing in non-map screens (KSC overview, VAB/SPH, etc.) after reverting from a flight to the SPH or VAB. I didn't notice this until I had selected Kerbin in the map view during a flight (in order to figure out where to land my spaceplane); since then, it's been happening pretty regularly, even after restarting KSP. Said icons are usually scattered near the top-right of the screen in the VAB/SPH immediately after the revert. Going to the KSC overview screen puts an icon over each of the KSC's launch sites. Going to the Tracking Center and back out seems to make the problem go away temporarily.

Any ideas? This is a pretty-heavily-modded install; perhaps it's a mod conflict of some sort? It looks like, though, that whatever draws the icons doesn't properly destroy itself when reverting back to the VAB/SPH. I've yet to notice this happen when recovering a vessel.

Share this post


Link to post
Share on other sites
And finally recovery factor is still 100% if in the effective range of a base.

Ah, thanks, I missed that.

Share this post


Link to post
Share on other sites
I've noticed a strange issue where base map icons (in my case for KerbinSide, but I'd imagine this would happen with other, non-KerbinSide KK bases as well) are appearing in non-map screens (KSC overview, VAB/SPH, etc.) after reverting from a flight to the SPH or VAB.... Any ideas?

Known bug. It's harmless though. Still working on a fix.

Share this post


Link to post
Share on other sites

Had some reports of some issues with recovery factor of KSC and spamming of the message app with useless reports about debris recovery. I've reproduced both issues and should have a fix out today hopefully.

Share this post


Link to post
Share on other sites
I've noticed a strange issue where base map icons (in my case for KerbinSide, but I'd imagine this would happen with other, non-KerbinSide KK bases as well)... Any ideas?

I've finally managed to track this down and thought a second reply explaining it may be useful for future reference for myself and for other modders.

The "map" is used in KSC's Tracking Station scene but when you go to map view it looks like the game still considers you to be in the Flight Scene. This explains some other KSP bugs, such as a nuclear explosion of water when you splash-down in map view.

When you revert a flight in map view, or switch to the space centre, KSP doesn't disable the map. This is a bug. KK's original code for displaying the icons was dependent on whether the map is enabled or not. Since the map isn't disabled when you revert or return to space centre from the map view, the icons continue to appear in the Space Center, VAB and SPH scenes.

The map is only disabled when you leave the map view to return to the flight scene or when you leave the tracking station scene and return to the space center scene.

Like I said, it is a KSP bug. I think I found a simple work-around for it for the next version of KK.

Edited by AlphaAsh

Share this post


Link to post
Share on other sites

v0.8.2 available from KerbalStuff.

Changelog:

  • Fixed KSC's Recovery Factor.
  • Fixed spamming of message app with useless messages about recovering debris.
  • Probably fixed odd bug with map icons following you to the space center, VAB and SPH when reverting flights or returning to the space center from the map view. It's harmless if it still happens.

Let me know if these bug fixes didn't fix the bugs.

Share this post


Link to post
Share on other sites

Guess which 'working' facilities I'm working on now.

guess.png

And what do you think they should do and how they should work? I've a few ideas but I'd like to hear yours.

Share this post


Link to post
Share on other sites
Kerbal Konstructs says that I have all these launchsites but any of them dont show up in the VAB launchsite selector. http://i.imgur.com/K0aBRE6.png

Those launchsites aren't launchsites if they don't have a 'transform' on the pad defined to allow launching of a vessel. What's the default launchpad transform set to? Check against other launchsite configs as examples to make sure you've defined them correctly.

STATIC
{
name = ksideairstr24
mesh = ksairstripv24.mu
module = Part
category = Runways
author = AlphaAsh
static = true
cost = 0
title = Runway
manufacturer = KashCorp
description = Planes crash on it.
[B]DefaultLaunchPadTransform = ksairstripv24_spawn[/B]
DefaultLaunchSiteLength = 1850.0
DefaultLaunchSiteWidth = 20.0

The model has to have an empty transform on it in Unity (under the parent GameObject) with a name with a suffix of _spawn. That then is defined in the model's config as you see in the example above.

Also each launchsite must have a UNIQUE launchsite name. If you've given all the launchsites the same name, when KK compiles a list of launchsites, it will only bother including the first one of any that have the same name. Each launchsite's instance LaunchSiteName must be unique.

Also check that LaunchPadTransform of each instance matches DefaultLaunchPadTransform. I've noticed KK sometimes forgets to do it and I haven't tracked that bug down. It's intermittent.

STATIC
{
name = ksideairstr24
mesh = ksairstripv24.mu
module = Part
category = Runways
author = AlphaAsh
static = true
cost = 0
title = Runway
manufacturer = KashCorp
description = Planes crash on it.
DefaultLaunchPadTransform = ksairstripv24_spawn
DefaultLaunchSiteLength = 1850.0
DefaultLaunchSiteWidth = 20.0
Instances
{
CelestialBody = Kerbin
RadialPosition = -287633,419087.3,-319416.6
Orientation = 0,1,0
RadiusOffset = 528.372
RotationAngle = 44.79999
RefLatitude = 44.27453
RefLongitude = 227.9971
VisibilityRange = 25000
Group = Ungrouped
[B]LaunchSiteName = Dundard's Edge Runway[/B]
LaunchPadTransform = ksairstripv24_spawn
LaunchSiteDescription = With the increased popularity of this location for advanced flight operations along the nearby river canyon, it didn't take long for a runway to be built to alleviate the need for VTOL launches from the base's helipad.
LaunchSiteLogo = DundardsEdgeRunwayLogo
LaunchSiteType = SPH
Category = Runway
OpenCost = 80000
CloseValue = 10000
OpenCloseState = Open
CustomInstance = False
LaunchRefund = 0
RecoveryFactor = 60
RecoveryRange = 75000
}
Instances
{
CelestialBody = Kerbin
RadialPosition = 262073.3,117237.1,-526232
Orientation = 0,1,0
RadiusOffset = 38.67077
RotationAngle = 299.5522
RefLatitude = 11.27818
RefLongitude = 296.4742
VisibilityRange = 25000
Group = KermanLake
[B]LaunchSiteName = Kerman Lake[/B]
...

In this example you can see I've more than one instance of the static launchsite. Each instance has a unique LaunchSiteName.

Launchsite instances are special in that they are keyed to the LaunchSiteName, rather than the RadialPosition, like other static instances which hold data (such as fuel tanks).

I'll throw a tutorial together explaining the setting up of a static model in Unity as a launchsite and then setting it up in game with KK.

Edited by AlphaAsh

Share this post


Link to post
Share on other sites

Setting Up a Static Launchsite's Spawn Point in Unity

For this tutorial, I'm going to put a spawn point on the end of this pier.

kktutspawn1.png

I've got the parent GameObject selected in the hierarchy. I'm going to add a Unity primitive, a cube to it.

kktutspawn2.png

Using a primitive like this, rather than an empty transform, just makes it easier to see and place.

kktutspawn3.png

Move and orientate your cube to where you want a vessel to spawn.

The Z axis (blue) is the direction the spawned vessel will face, if spawning from the SPH. The Y axis (green) is the top of the vessel, or the way a vessel will point if spawned from the VAB.

kktutspawn4.png

Rename the cube to something_spawn. Remove all of its components except the transform.

kktutspawn5.png

And that's your spawn point defined. Build your .mu with parttools and then go write your config for KK.

Edited by AlphaAsh

Share this post


Link to post
Share on other sites

Creating a Configuration File for a Static

Got a new static model.mu you want to use with KK? It needs a .cfg file in the same directory as that model.

Here's a template:

STATIC
{
name =
mesh =
module = Part
category =
author =
static = true
cost =
title =
manufacturer =
description =
DefaultLaunchPadTransform =
DefaultLaunchSiteLength =
DefaultLaunchSiteWidth =
}

name

A unique identifier for KSP's config loader. Un-used by KK though - it indexes static models by mesh name.

mesh

The model's name. Include .mu on the end.

module = Part

No idea if it's needed by KSP. Un-used by KK. *shrug* I leave it in anyway.

category

KK's editor allows filtering of static models by category. Common example: Airfields

author

Your name here.

static = true

No idea if it's needed by KSP. Un-used by KK. *shrug* I leave it in anyway.

cost

I plan for KK to do something with this eventually. Just set it to 0 for now.

title

Friendly descriptive title of your static. Example: A Nice Runway

manufacturer

Not really used by KK much. I tend to use it as an identifier for whatever mod this is for.

description

It's a description.

DefaultLaunchPadTransform

If your static is going to be able to launch vessels then it needs this to have a value that matches the name of the transform you defined in Unity. It should end with _spawn. If your static isn't going to launch vessels, you don't need to include this.

DefaultLaunchSiteLength

A number in meters. Don't add an m. Decimals are fine. If your static isn't going to launch vessels, you don't need to include this.

DefaultLaunchSiteWidth

A number in meters. Don't add an m. Decimals are fine. If your static isn't going to launch vessels, you don't need to include this.

Edited by AlphaAsh

Share this post


Link to post
Share on other sites

guess2.jpg

The latest feature for Kerbal Konstructs is proving to be a bigger bit of work than I anticipated. I've had to throw the design spec in the bin a few times due to lack of ambition or over-ambition.

What you can see in the screenshot is still very much a proof of concept but is starting to take shape as something actually doable and possibly actually a fun and useful feature.

It's also laying the foundations for future 'working facilities' features as well as setting up more functionality for the 'base founding per save-game' feature that I've been so desperately trying to implement these last few months.

A big concern that I am currently completely ignoring, at least for now, is stepping on the toes of other mods. I'll worry about that once I've actually got a semi-working feature.

Share this post


Link to post
Share on other sites

I just looked into the code a bit and I'm confused.

To get an Instance of a StaticObject I have to search the list I get from (new KerbalKonstructs.KerbalKonstructs()).getStaticDB().getAllStatics(), right?

How do I get the current position and orientation of that object?

Share this post


Link to post
Share on other sites
I just looked into the code a bit and I'm confused.

To get an Instance of a StaticObject I have to search the list I get from (new KerbalKonstructs.KerbalKonstructs()).getStaticDB().getAllStatics(), right?

How do I get the current position and orientation of that object?

Take a look at the StaticObject class. You'll need to use getSetting, or the properties of the instance. Depends on the circumstances but you can see examples in EditorGUI.cs.

All instances are positioned using KSP's PQSCity functions. The same functions that handle the stock statics/buildings in KSP.

Also bare in mind I haven't updated Git in a while because... well, I'm lazy.

And also bare in mind there's a lot of KerbTown (and then medsouz) legacy in the code and it's structure will confuse you. I am in fact right now re-organising the entire project to use OO more... correctly. Kerbal Konstructs may as well have been developed in C, the way it's currently structured.

Edited by AlphaAsh

Share this post


Link to post
Share on other sites

Getting this error from Kerbinside.

NullReferenceException: Object reference not set to an instance of an object

at KerbalKonstructs.KerbalKonstructs.OnVesselLaunched (.ShipConstruct vVessel) [0x00000] in <filename unknown>:0

at EventData`1[shipConstruct].Fire (.ShipConstruct data) [0x00000] in <filename unknown>:0

at FlightDriver+.MoveNext () [0x00000] in <filename unknown>:0

When ever I go to revert the flight it crashes the game.

Share this post


Link to post
Share on other sites
And also bare in mind there's a lot of KerbTown (and then medsouz) legacy in the code and it's structure will confuse you. I am in fact right now re-organising the entire project to use OO more... correctly. Kerbal Konstructs may as well have been developed in C, the way it's currently structured.

This sounds like no small task, and I commend you for taking it on. It might be too much to ask, but is it possible that somewhere in this process the base definitions could be made more modular? As in global base coordinates with local offsets rather than a collection of separate instances that happen to be next to each other?

Share this post


Link to post
Share on other sites

Found the error... it is caused by not having any of the other airfields open.

Share this post


Link to post
Share on other sites
Found the error... it is caused by not having any of the other airfields open.

Thanks chap. I'll take a look at fixing this today.

- - - Updated - - -

This sounds like no small task, and I commend you for taking it on. It might be too much to ask, but is it possible that somewhere in this process the base definitions could be made more modular? As in global base coordinates with local offsets rather than a collection of separate instances that happen to be next to each other?

This is something my wife wanted to implement awhile back but we never got around to it. I'll put the foundation in for something like it but I'll probably extend group methods to handle it, since some of that is there already.

Share this post


Link to post
Share on other sites
Take a look at the StaticObject class. You'll need to use getSetting, or the properties of the instance. Depends on the circumstances but you can see examples in EditorGUI.cs.

Thanks :)

I found some methods which convert RadialPosition into Lon/Lat. That's really helpful!

Share this post


Link to post
Share on other sites

Hey, so I'm making some static models for KK. I made the model in blender, exported it to unity and set the parameters you would if you were making a part, after which I wrote it to an .mu file and added a .cfg. When I load up the game however, and attempt to place the static, KK begins to spam this exception:

NullReferenceException: Object reference not set to an instance of an object  at KerbalKonstructs.StaticObjects.StaticGroup.updateCacheSettings () [0x00000] in <filename unknown>:0 

at KerbalKonstructs.StaticObjects.StaticGroup.addStatic (KerbalKonstructs.StaticObjects.StaticObject obj) [0x00000] in <filename unknown>:0
at KerbalKonstructs.StaticObjects.StaticDatabase.addStatic (KerbalKonstructs.StaticObjects.StaticObject obj) [0x00000] in <filename unknown>:0
at KerbalKonstructs.UI.EditorGUI.spawnInstance (KerbalKonstructs.StaticObjects.StaticModel model) [0x00000] in <filename unknown>:0
at KerbalKonstructs.UI.EditorGUI.drawEditorWindow (Int32 id) [0x00000] in <filename unknown>:0
at UnityEngine.GUI.CallWindowDelegate (UnityEngine.WindowFunction func, Int32 id, UnityEngine.GUISkin _skin, Int32 forceRect, Single width, Single height, UnityEngine.GUIStyle style) [0x00000] in <filename unknown>:0

(Filename: Line: -1)


NullReferenceException: Object reference not set to an instance of an object
at KerbalKonstructs.StaticObjects.StaticGroup.updateCache (Vector3 playerPos) [0x00000] in <filename unknown>:0
at KerbalKonstructs.StaticObjects.StaticDatabase.updateCache (Vector3 playerPos) [0x00000] in <filename unknown>:0
at KerbalKonstructs.KerbalKonstructs.updateCache () [0x00000] in <filename unknown>:0

(Filename: Line: -1)


NullReferenceException: Object reference not set to an instance of an object
at KerbalKonstructs.StaticObjects.StaticGroup.updateCache (Vector3 playerPos) [0x00000] in <filename unknown>:0
at KerbalKonstructs.StaticObjects.StaticDatabase.updateCache (Vector3 playerPos) [0x00000] in <filename unknown>:0
at KerbalKonstructs.KerbalKonstructs.updateCache () [0x00000] in <filename unknown>:0

I was wondering if anyone more skilled in interpreting this than me can tell me what it is that I've done wrong. Thanks in advance for any help.

Share this post


Link to post
Share on other sites
Hey, so I'm making some static models for KK. I made the model in blender, exported it to unity and set the parameters you would if you were making a part, after which I wrote it to an .mu file and added a .cfg. When I load up the game however, and attempt to place the static, KK begins to spam this exception:

NullReferenceException: Object reference not set to an instance of an object  at KerbalKonstructs.StaticObjects.StaticGroup.updateCacheSettings () [0x00000] in <filename unknown>:0 

at KerbalKonstructs.StaticObjects.StaticGroup.addStatic (KerbalKonstructs.StaticObjects.StaticObject obj) [0x00000] in <filename unknown>:0
at KerbalKonstructs.StaticObjects.StaticDatabase.addStatic (KerbalKonstructs.StaticObjects.StaticObject obj) [0x00000] in <filename unknown>:0
at KerbalKonstructs.UI.EditorGUI.spawnInstance (KerbalKonstructs.StaticObjects.StaticModel model) [0x00000] in <filename unknown>:0
at KerbalKonstructs.UI.EditorGUI.drawEditorWindow (Int32 id) [0x00000] in <filename unknown>:0
at UnityEngine.GUI.CallWindowDelegate (UnityEngine.WindowFunction func, Int32 id, UnityEngine.GUISkin _skin, Int32 forceRect, Single width, Single height, UnityEngine.GUIStyle style) [0x00000] in <filename unknown>:0

(Filename: Line: -1)


NullReferenceException: Object reference not set to an instance of an object
at KerbalKonstructs.StaticObjects.StaticGroup.updateCache (Vector3 playerPos) [0x00000] in <filename unknown>:0
at KerbalKonstructs.StaticObjects.StaticDatabase.updateCache (Vector3 playerPos) [0x00000] in <filename unknown>:0
at KerbalKonstructs.KerbalKonstructs.updateCache () [0x00000] in <filename unknown>:0

(Filename: Line: -1)


NullReferenceException: Object reference not set to an instance of an object
at KerbalKonstructs.StaticObjects.StaticGroup.updateCache (Vector3 playerPos) [0x00000] in <filename unknown>:0
at KerbalKonstructs.StaticObjects.StaticDatabase.updateCache (Vector3 playerPos) [0x00000] in <filename unknown>:0
at KerbalKonstructs.KerbalKonstructs.updateCache () [0x00000] in <filename unknown>:0

I was wondering if anyone more skilled in interpreting this than me can tell me what it is that I've done wrong. Thanks in advance for any help.

Something isn't right with either the .mu or the .cfg. Package them along with the needed textures in a .zip, host it somewhere and then PM me the link and I'll take a look. If it isn't the .cfg at fault, then KSP didn't load the .mu properly which means there's a problem with the model.

EDIT:

Problem 1 -

mesh =

in your config must have a value the same as your model name. So if your model is mymodel.mu, for example, then in the config it should be

mesh = mymodel.mu

Problem 2 -

Don't include a stub for instances. KK will try to load an instance with no data and will crash.

This:

Instances
{
}

shouldn't be in your config. KK will write the Instances as you spawn them in-game.

Edited by AlphaAsh
  • Like 1

Share this post


Link to post
Share on other sites

v0.8.3_EX available from KerbalStuff.

Changelog:

  • This is an experimental version. That means that you may well find bugs and problems. If you don't want to help test this version, stick with the previous version.
  • Added feature support for Air Racing.
  • Added Group and Facility Type properties to the Instance Editor.
  • You can now set an individual instance's Group and FacilityType.
  • FacilityType has limited use for now but is necessary if you want to make your own race tracks. It's a special tag that tells KK if an instance is a facility and/or has a function of some sort.
  • Re-designed the GUI for the Tracking Station and Map View Base Boss.
  • Added stub for the WIP 'working' tracking Stations feature in the Tracking Station and Map View Base Boss. This is just a preview of an upcoming feature I didn't disable for this release.
  • Began re-organising the plug-in to be more object-oriented. This may mean bugs I miss in testing! Please report them!

HOW TO GET AIR RACING

  1. If you want to air race you need Kerbal Konstructs and some tracks configued to use the racing feature. Try KerbinSide Air-Race.
  2. KerbinSide Air-Race currently has three tracks: KSCRace near KSC (easyish track), Dundards near Dundard's Edge (really very tricky track) and The Krags, near Black Krags (tricky track).
  3. To run a race, open Base Boss in flight and click the button 'I want to race!'
  4. The Base Boss will close and the race app will open. It'll tell you the distance to the nearest start line. Cross that start line to start the race.

Edited by AlphaAsh

Share this post


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