Jump to content

gurntmaster1

Members
  • Posts

    6
  • Joined

  • Last visited

Reputation

0 Neutral

Profile Information

  • About me
    Bottle Rocketeer
  1. Thanks for all of the replies, got a lot more than I had hoped for. Although I am not quite sure in what direction I will take the device, I guess it will depend on "gameplay". Your posts helped me get some perspective though, so they weren't in wain .
  2. Ouch, maybe I should either re-think it as a rail gun (applies large force at close range) or explain how it works through some other means (as mentioned space magic is kind of the theme, already got a propulsion which uses electricity to either reduce or reverse the effect of gravity). So, how would an artificial gravity field work (mostly in terms of degrading)?
  3. Thanks for the reply. Wow, the force degrades really fast, if i set (u * M1 * M2) so that F = 120 at r = 1, then F ~ 0.99 at r = 11 I might just give real physics the finger on this one. One thing that seems a bit odd is that as r gets closer to 0, F will get closer to infinity. I would have expected that there was a Max F at r = 0 (not possible according to this equation).
  4. Hello world. I am currently working on a mod, trying to add (space magic fueled) future technologies. One device is an electromagnet, which can be used to build accelerator stations. Currently it works by applying F force to the magnet and each vessel within M range. The formular is: F: Force to apply f: Force at 0 distance m: Current distance between magnet and object M: max distance that an object can be affected. F = f * (1 - m / M) Something tells me though that this isn't really how it works in real physics and as that is an important part of the gameplay, I would like to keep things as close to that as possible. Could someone help me understand how a more accurate formular would look like?
  5. I apologise if this against forum rules, but I felt it was better to post an answer in a seperate post for future reference. So, I actually found an answer to the Gravity Inverter, which I had thought would be the hardes/impossible one. Sadly, I can't take much credit for it as it was mostly copy pasting from one of the anti-gravity mods with some slight tweaking to it. You can find the mod here: http://forum.kerbalspaceprogram.com/threads/9618-PLUGIN-PARTS-0-16-Gravity-Canceller-v1-1 Here is the final code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using UnityEngine; namespace MyKSPProject { class GravityInverter : PartModule { [KSPField(isPersistant=true)] public bool isActive=false; private const float geeForceAtKerbin = 9.81F; private const float maxGee = 5F; private float torque = 0F; public override void OnFixedUpdate() { base.OnFixedUpdate(); if (!isActive) return; if (rigidbody != null) { Vector3 gee = FlightGlobals.getGeeForceAtPosition(transform.position); float velocity = Vector3.Dot(gee.normalized, rigidbody.velocity); torque = FlightInputHandler.state.mainThrottle * 2; foreach (Part p in vessel.parts) if ((p.physicalSignificance == Part.PhysicalSignificance.FULL) && (p.rigidbody != null)) p.rigidbody.AddForce(-gee * p.rigidbody.mass * torque); } } [KSPEvent(guiActive= true, guiName="Activate")] public void ActivateEvent() { isActive = true; Events["ActivateEvent"].active = false; Events["DeactivateEvent"].active = true; } [KSPEvent(guiActive = true, guiName = "Deactivate", active = false)] public void DeactivateEvent() { isActive = false; Events["ActivateEvent"].active = true; Events["DeactivateEvent"].active = false; } } } When activated, it will cancel gravity at 50 % throttle, reduce it below 50 % and invert it above 50 %.
  6. I wanted to implement some new devices fueled by space magic, but as I am new to KSP modding and ended Physics at 10th grade, figuring out the proper areas and variables to alter has been a bit hard. For now I have added an (almost) functional velocity negater. My questions are for some other devices though. One device is an accelerator ring that applies thrust (or what the proper term would be for this case) to itself and either a specific, or all nearby vessels. In practice it will function as a form of rail gun, applying "free" thrust to another vessel, but having to correct its orbit due to having the "thrust" also applied to itself. My main questions are: 1. how to locate the nearby vessel(-s). 2. check the distance between the Accelerator Ring and the vessels. 3. How to perform the attraction between them. The second device is a repulsion system that works by inversing the force of the main body's gravity. I am a bit stuck here on how to aproach it. Is there a variable defining the force applied to the vessel by gravity that can be altered? Should a velocity vector be altered based on current altitude (please include formulars )? Or is there some other aproach.
×
×
  • Create New...