Jump to content

Modding Help


jmbon

Recommended Posts

Hello, 

    I am new to modding KSP and I am having some difficulty that maybe the community could help me with. I am trying to get the surface area of the vehicle but to do that, I either need the activevessel radius (in cases of simple rockets) or a List<Part> parts that contains the current parts attached to the vehicle that I could then use to make an educated guess as to the vessels radius (for more complex ships as 3 Rockomax Jumbo-64 Fuel Tanks are likely to be side by side, etc.). Right now, I am assuming rockets can be approximated by cylinders as getting the true shape of the vessel would be a nightmare. The problem is that when looking through the API calls, I don't see anything references to vessel radius and when I call;

public List<Part> parts_ = new List<Part>();
parts_ = FlightGlobals.ActiveVessel.GetActiveParts();
Debug.Log("\n\nVessel parts are: " + craft.parts + "\n\n");

Visual Studio errors on: 

Error    11    The type 'UnityEngine.EventSystems.IPointerClickHandler' is defined in an assembly that is not referenced. You must add a reference to assembly 'UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.    c:\users\joshua\documents\visual studio 2013\Projects\KSP_Wind\KSP_Wind\Class1.cs    92    27    KSP_Wind

I am not using any GUI options and my includes are:

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using KSP;

I know that the error is coming from <Part> because when I change it to 

public List<String> parts_ = new List<String>();

I no longer get that error. (I know I'll get another because String is incompatible with FlightGlobals.ActiveVessel.GetActiveParts();).

I am unsure how to correct this issue nor am I even sure that I am on the correct track on how to either get the vessel radius or the list of currently attached parts. 

I greatly appreciate any help you can give. Thanks. 

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