Jump to content

Search the Community

Showing results for tags 'api'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements
    • The Daily Kerbal
  • Kerbal Space Program 2
    • KSP 2 Discussion
    • KSP 2 Dev Diaries
    • KSP 2 Suggestions & Development Discussion
    • Show and Tell
  • Kerbal Space Program
    • KSP Discussion
    • KSP Suggestions & Development Discussion
    • Challenges & Mission ideas
    • The Spacecraft Exchange
    • KSP Fan Works
  • Community
    • Welcome Aboard
    • Science & Spaceflight
    • Kerbal Network
    • The Lounge
  • Gameplay and Technical Support
    • Gameplay Questions and Tutorials
    • Technical Support (PC, unmodded installs)
    • Technical Support (PC, modded installs)
    • Technical Support (PlayStation 4, XBox One)
  • Add-ons
    • Add-on Discussions
    • Add-on Releases
    • Add-on Development
  • Making History Expansion
    • Making History Missions
    • Making History Discussion
    • Making History Support
  • Breaking Ground Expansion
    • Breaking Ground Discussion
    • Breaking Ground Support
  • International
    • International
  • KerbalEDU Forums
    • KerbalEDU
    • KerbalEDU Website

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Skype


Twitter


About me


Location


Interests

Found 14 results

  1. KSPWheel - An alternate physics-based wheel collider solution for Kerbal Space Program. This is not a parts mod. It does not add new parts to the game. It is useless by itself. What it is, is a new Wheel Collider component, and a set of PartModules to enable its use on stock-rigging-compatible wheel models. It is intended to be packaged as a dependency with other mods, similar to how FireSpitter / ModuleManager are used. What it does is provide a new physics-based wheel collider that is not subject to the limitations or performance constraints of the Unity5 WheelCollider component or the stock KSP PartModules. It allows for multiple colliders in a single model with arbitrary collider orientations. It uses a discrete spring/damper based suspension model that properly responds to changes in wheel loading (add more weight, and the suspension compresses more) (also now includes an optional auto-spring-calculation mode). Includes curve-based independently tune-able lateral and longitudinal friction calculations, configurable rolling resistance, accurate and configurable motor power use calculations, and configurable steering parameters. There is nothing here intended for end-user use. This plugin is an API and consists purely of functions and features intended for other mods and modders to use. This thread is intended as a centralized area for discussion of features and balance. DO NOT use it to submit bug reports. You may -check- with others to see if something is a bug through the forum thread, but if it turns out to be a bug, you -must- file a report through github; failure to properly file the bug report will result in the bug not being fixed. Downloads: https://github.com/shadowmage45/KSPWheel/releases Documentation: https://github.com/shadowmage45/KSPWheel/wiki Bug Reports: Only accepted through Github. Include logs (KSP.log), screenshots if applicable, and steps for duplication or your issue will be summarily closed without response. Be polite, do the responsible thing, and file proper bug reports. Bugs reported on the forums will result in being reported to moderators for cluttering the thread and being personally ignored. Just don't do it. If you can't be bothered to submit a proper bug report, I'm not going to bother to fix your problem. Source: https://github.com/shadowmage45/KSPWheel License: Source is licensed under GPL. Please see the accompanying license files, browse them at the repository, or view them on the web at: https://www.gnu.org/licenses/gpl-3.0.en.html Legal / Other: This mod redistributes ModuleManager under its own license terms. KSPWheel is Used in the following mods (pm me to be added to the list):
  2. Modders should by allowed to change (override) logic of asteroid spawn by SentinelModule. Curenly SentinelModule can spawn asteroids by avoiding standart way. Also its will be very helpful to document how exactly SentinelModule spawn asteroids to reproduce it in custom parts.
  3. I'm trying to make a mod for KSP that calculates stuff, and I need to access a list of all engines that are unlocked. Then, I need to access instance variables of the engines, such as their ispVac, ispASL, thrustASL, and thrustVac. I don't know if you can tell, but I've scoured the API documentation for a little while looking for something like it. I'd prefer an array of just the 1.5m liquid fuel rocket engines, but I can make a new array if needed. Thanks. I apologize if this isn't where it should be or is formatted incorrectly.
  4. This Mod provides an c# API so you can write your own prelaunch Checks, that run when you press the launch button in the VAB or SPH. currently it is used by Kerbal Konstructs. Get the latest version here: https://github.com/GER-Space/AdvancedTextures/releases/tag/1.8.1 Some documentation how it is used is written here: https://github.com/GER-Space/CustomPreLaunchChecks/wiki
  5. The KSP api has become pretty large now, with over 2000 classes, and as it has no documentation it can be a struggle to find out what anything does. There have been a couple of attempts to create community driven documentation, but they have all been difficult to update and have stalled. I present to you the KSP API Wiki It uses reflection to build up a framework of all the classes, methods, fields etc and then allows you to attach a comment to each. It also downloads the squad API documentation and includes that. It is pre-populated with the comments already created in the anatid documentation created by The_Duck Come if you want to know what the modding communities best guess of what a method does, and if there is a class that you have used that isn't documented, please help out by adding an appropriate comment. No account required. Huge thanks to @micha for providing working hosting allowing this project to continue.
  6. Hello KSP forum players I need help to create a plugin for the OptionalAtmosphere mod, the plugin will deactivate the non-existent atmospheres in UI only (help me please)
  7. Dear international friends: I've been working on the plugin recently, and I wonder what's the Instance fields in kerman's hatch and back? As is shown in Thanks!
  8. I'm maintaining the USAF Orion mod, and it's been noticed that vessel mass is not decreasing as pulse units are expended. I chucked in some diagnostic logging and what seems to be happening is the parts (essentially custom fuel tanks) are decreasing in mass, but the vessel isn't. So, adjusting the mass of a pulse unit magazine is done with this super complex formula; this.mass = (this.bombStockpile * this.bombMass) + this.dryMass ; Debug.Log("[USAFOrion] adjusted mass of magazine " + this.bombStockpile + " to " + this.mass); With my little debug line. And mass (and bombStockpile) decrease as the units are used up. But when I add in; Debug.Log("[USAFOrion] Nominally this should have updated the vessel mass. It now shows : " + vessel.totalMass); the vessel doesn't change mass at all. Even if I run vessel.UpdateResourceSets(); base.onPartFixedUpdate () ; which would seem to be the sort of thing you do to recalc vessel things. So, A: Am I adjusting the part mass at all, or just some value that doesn't actually come into play anywhere? B: If (A:), is there a way of triggering KSP to recalculate mass (and CoM) of the vessel?
  9. I've got serious problem with using a List / Dictionary collection classes where adding data in one event does not propagate to other event. Code example: using System; using System.Collections.Generic; using System.Linq; using System.Text; using UnityEngine; namespace TestPartPlugin { public class TestPartPlugin : PartModule { public struct teststruct { public string s; public int i; } public class testclass { public string s; public int i; } // this is shared among events, it will be passed as argument, for purposes of this example its not a problem ? public List<teststruct> l = new List<teststruct>(); public string ss; public override void OnLoad(ConfigNode node) { base.OnLoad(node); ss = new string('x', 10); // just allocate in runtime and fill it with dummy data, for reference to the problem at hand teststruct t; //now the interesting part for (int i = 0; i < 10; i++) { t = new teststruct(); //also did same with testclass, same problem t.s = "a"; //dummy fill t.i = i; l.Add(t); //add new item. if i looped in collection inside here, it would work } } public override void OnStartFinished(StartState state) // now the troublesome part { base.OnStartFinished(state); Debug.Log("LIST DUMP START"); foreach (teststruct t in l) Debug.Log("string: " + t.s + " int: " + t.i.ToString()); // BANG ! List/struct is empty ! Debug.Log("LIST DUMP END"); Debug.Log("simple string test: " + ss); //this worked, meh ... } } } I need a mutable collection that will be filled in OnLoad() and then later being used in OnStartFinished() . Right now, when i fill data in OnLoad(), inside OnStartFinished() my collection will be empty, no data is present. What now ? would using "out" keyword in method argument work ? I tried "ref" also with no result.
  10. Hello everyone from ksp here is my second mod (it's not a mod but a plugin!) My plugin will be alien manager. But in the future the mods will be public. thank you for your patience
  11. Bonus Tips : A Random Guide to PartModules A year ago I started to delve deeper into C# and Unity's API as a hobbyist programer. I've learned a lot since then and now I'm giving that information to you, in no particular order. Random Tip #1 - KSP PartModules are Unity Game Object Components Any class in C# that inherits from the Unity Monobehaviour class is a Game Object component. This is more a conceptual cornerstone rather than a practical tip. KSP's API already has a bunch of ways to get at its many different classes and structs, but keep this in mind. You can always use Unity's vanilla methods regarding component Adding, Subtracting, Destroying, Instantiating, and the like regarding your own PartModule class as well as other KSP Classes which have inherited from Monobehaviour. Random Tip #2 - Don't Forget About Unity KSP's API is built on top of the Unity API. Unity has pretty vast documentation and StackOverflow style Unity Answers. Don't forget to use these resources. Most of the progress I've made modding KSP has come from going through Unity tutorials on Youtube. Random Tip #3 - Don't Listen to Anyone Older than One Well, maybe listen, but certainly don't blindly trust. There is a lot of information out there about Unity and a good amount from 2011. Much of it is obsolete now that KSP is built on Unity 5.4. For instance, did you know that Unity 5 now automatically caches Transforms? Yeah it does, when you access a Transform through a method search like Find() Unity will automatically cache that transform in memory. However in 2011 you had to assign the Transform to a variable within your class if you wanted to keep that Transform available in memory. So, don't fully trust information older than a year. Random Tip #4 - How to Lerp Using lerp functions is actually very easy. Lerp or linear interpolation is a way to return the incremental value between two bounds at a given time assuming a constant speed. Think of an animation clip. It has a frame at the beginning, Frame 0, and a frame at the end, Frame 60. Frames 0 through 60 represent 61 units of time. Now imagine we want to animate the position of a game object on the Y axis from 0 meters to 1 meter. We set the value of Y for the first frame to 0 (Frame 0, Y = 0) and the value of Y for the last frame at 60 to 1 (Frame 60, Y = 1). Imagine we scrub to Frame 30 in the timeline, what will the value of Y be? Yes it's 0.5, because the value of Y is progressing in a linear fashion. So, how do we use the lerp function. There's a couple of things to keep in mind. A lerp function will only ever return a single value, it's just an equation. Lerp isn't meant to be used as an easing function. It can be, but that's just a hack. Because it only returns a single value at a given time, all lerp functions need to be used in a loop of some kind. Preferably in a Unity update method, like FixedUpdate(). Let's lerp: public Transform t = somethingWeWishToMove.transform; public float startTime = -1f; public bool isLerping = true; public void FixedUpdate() { if(isLerping) { if(startTime == -1f) startTime = Time.time; t = new Vector3(0f, (Mathf.lerp(0f,1f,startTime/Time.time))*TimeWarp.fixedDeltaTime, 0f); if(Time.time >= 60f) { isLerping = false; startTime = -1f; } } } That's it for today, I'll be posting more again soon. Next time we'll be delving into the Delta of Time. Till then, Happy coding
  12. In a museum setting, Kerbal Space Program would be COOL, but very high maintenance out-of-the-box for the casual visitor (e.g. dedicated docents keep people trapped while configuring and testing lengthy missions). I'm thinking about something more self-serve, freeing up time for docents to move around and open up a display for additional users. A dream (without much knowledge about KSP add-ons or functionality...yet): Create a kiosk app that lets people choose a few options in a visual menu system (not in KSP yet). Wing configuration, body type, rocket length, stage options, etc.,. Will it make it to orbit??? The kiosk app creates a script and launches KSP with options. Kerbal people nod at each other and the rocket launches. Fail or success?? You will see, then have the option to try again. Bonus: share with your friends via the touch screen kiosk (post-flight kiosk feature). No keyboard. No mouse. No KSP menus unrelated to kiosk goals. Just touch and go and repeat. Does this seem remotely possible? I see an extensive API and add-on capabilities. This looks like a great start! Worst case, I see recording several options and playing videos based on selections. This does get complex to handle with more options though. I don't need specifics, but good clues will help me get started. Thanks for taking a look!
  13. The KSP api has become pretty large now, with over 2000 classes, and as it has no documentation it can be a struggle to find out what anything does. There have been a couple of attempts to create community driven documentation, but they have all been difficult to update and have stalled. I present to you the KSP API Wiki It uses reflection to build up a framework of all the classes, methods, fields etc and then allows you to attach a comment to each. It is pre-populated with the comments already created in the anatid documentation created by The_Duck Click if you want to know what the modding communities best guess of what a method does, and if there is a class that you have used that isn't documented, please help out by adding an appropriate comment. No account required.
  14. I'm working on yet another landing guidance plugin. I'm almost ready to share an early version, but I'm having trouble with the coordinate system. In particular, I'm trying to find the latitude and longitude of the active vessel on its current orbit at some arbitrary time in the future, taking into account the rotation of the planet. The code looks something like this (with a nod to KER for inspiration): Vector3d position = vessel.GetOrbit().getPositionAtUT(currentTime + deltaT); double bodyRot = 360 * (deltaT) / body.rotationPeriod; double lat = body.GetLatitude(position); double lon = NormAngle(body.GetLongitude(position) - bodyRot); //NormAngle normalises the angle between -180, 180. When I continue on the current orbit and sample the actual lat and long at UT = currentTime + deltaT, I find: a ) Lat and long are both a bit off (0-2 degrees), thought long is usually more wrong than lat (possibly suggesting that my bodyRot is incorrect). b ) The error is greater the further in advance I try to calculate the lat and long (if I calculate no more than a few minutes into the future the error is negligible). I suspect that my understanding of the value returned by Orbit.getPositionAtUT() might be incorrect. It seems to return a value which is sort of "the position that the vessel would be in at time UT if the main body stopped moving", which I think would make my logic consistent. But either of those assumptions may be wrong. Can anyone offer any advice, or an alternative method?
×
×
  • Create New...