Jump to content

JediMasterSterling1

Members
  • Posts

    14
  • Joined

  • Last visited

Reputation

1 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I'm fairly new in mod development, started playing around in with some code. I want to simulate a vessels trajectory in the background, and then display it on screen. I figure an easy way to do this would be to create a vessel, read the forces on it, move it to an updated location, repeat a sufficient number of times, and delete it before the game calculates the next frame. I figured I'd start basic and build up from there so my first test was to save the active vessel to a ProtoVessel, delete the active vessel, and reload it from the ProtoVessel Here's the code. ProtoVessel pv = FlightGlobals.ActiveVessel.BackupVessel(); FlightGlobals.ActiveVessel.Unload(); FlightGlobals.RemoveVessel(FlightGlobals.ActiveVessel); FlightGlobals.ActiveVessel.StartFromBackup(pv); FlightGlobals.ActiveVessel.Load(); FlightGlobals.AddVessel(FlightGlobals.ActiveVessel); Unfortunately it failed miserably. I've tried several variations on this code, in case I'm just getting the order wrong, but nothing works. I've seen mods produce new functioning vessels in game, so it should be possible. Anyone know what I'm missing?
  2. This may seem like necro-posting but I feel the question never did get answered and this question may come up for someone else again. You posted that your need is specifically with kOS. The following command does the same thing as pressing 'x' so you can put this into your code once and always come out of script with a 0 throttle. SET SHIP:CONTROL:PILOTMAINTHROTTLE TO 0.
  3. In case anyone else reads this. EditorLogic.fetch.ship.parts also gives a list of parts in editor.
  4. I got stuck again. So to access the vessel parts list in flight one uses "FlightGlobals.ActiveVessel.parts". How does one access the vessel part's list in editor?
  5. Tralfagar What are the references you're using with that?
  6. I'm aware it's very basic so I'm sorry if it's been answered before. I have looked. This about the third time I've tried to get into modding ksp and each time I end up drowning in data I either don't need or that's out dated. I'm a descent programmer and have plenty of time to fiddle with things to figure them out, but I at least need a jumping off point. What I need is an in flight app button that opens a "hello world" GUI page. From there I'm sure I can solve most of my questions myself. Thanks much.
  7. IT WORKS! Thanks, I would never have found these parameters on my own.
  8. Fair enough. Where would I find info on how to develop and integrate a new module like the one you suggest? Also I could get a similar effect by changing drag on the propeller disk given velocity if that would be easier
  9. I'm altering the config file of an electric propeller engine. It previously would either not get off the ground, or get all the way to orbit. So it needed a reality check. The physics of a propeller are such that without the compressor jets have efficiency drops off almost linearly with pressure, and also as the propeller blades exceed the speed of sound they become drag devices rather than lift devices. A standard base line seems to be a supersonic buzzing starting at around mach 0.85, net trust dropping to 0 by about mach 0.90 and thrust going negative past that. Altering the forces is pretty easy using atmCurve{} and velCurve{}. Making sure the engine still draws power is a bit more difficult. I solved the problem with atmosphere drop off by using atmosphereCurve{} like so. name = ModuleEnginesFX ... atmosphereCurve { key = 0 800 0 1000000 key = 0.000001 0 0 0.3012048 key = 0.5 789.496 0.02686068 0.02686068 key = 20 960 0 0 } // Jet params ... atmCurve { key = 0 0 0 0 key = 0.000001 0 0 0.3012048 key = 0.5 0.98687 0.02686068 0.02686068 key = 20 1.2 0 0 } So that force and efficiency drop at the same time and at the same rate. I would like to do the same thing with velocity. Here's what I tried: name = ModuleEnginesFX ... velocityCurve { key = 0 600 0 0 key = 0.5 800 0 0 key = 0.85 400 -2.125082 -29.05206 key = 1 800 0 0 } // Jet params ... velCurve { key = 0 0.75 0 0 key = 0.5 1 0 0 key = 0.85 0.5 -2.125082 -29.05206 key = 1 -1 0 0 } But the game doesn't recognize velocityCurve{} as anything even though I'm fairly sure I've seen it used before. (can't remember where) As is the game follows velCurve{} by changing the flow of electricity rather than engine efficiency. However it makes no sense to have the propeller tips experiencing extreme supersonic drag at mach 0.90 but not requiring any power to keep moving and even less sense to have the propeller creating drag similar to a 1m parachute at mach 1 and actually be producing electricity. Is there something small I'm missing in syntax, am I way off the mark, or is this idea impossible using base game mechanics? Here's the whole module: MODULE { name = ModuleEnginesFX thrustVectorTransformName = thrustTransform exhaustDamage = False ignitionThreshold = 0.1 minThrust = 0 maxThrust = 50 heatProduction = 8 useEngineResponseTime = True engineAccelerationSpeed = 20 engineDecelerationSpeed = 20 //useVelocityCurve = True EngineType = Turbine PROPELLANT { name = ElectricCharge ratio = 0.4 DrawGauge = True } PROPELLANT { name = FSCoolant ignoreForIsp = True ratio = 0.01 } atmosphereCurve { key = 0 800 0 1000000 key = 0.000001 0 0 0.3012048 key = 0.5 789.496 0.02686068 0.02686068 key = 20 960 0 0 } // Jet params atmChangeFlow = False useVelCurve = True useAtmCurve = True flameoutBar = 0.001 flowCapMult = 1.0 machHeatMult = 10 atmCurve { key = 0 0 0 0 key = 0.000001 0 0 0.3012048 key = 0.5 0.98687 0.02686068 0.02686068 key = 20 1.2 0 0 } velCurve { key = 0 0.75 0 0 key = 0.5 1 0 0 key = 0.85 0.5 -2.125082 -29.05206 key = 1 -1 0 0 } }
  10. I'm altering the config file of an electric propeller engine. It previously would either not get off the ground, or get all the way to orbit. So it needed a reality check. The physics of a propeller are such that without the compressor jets have efficiency drops off almost linearly with pressure, and also as the propeller blades exceed the speed of sound they become drag devices rather than lift devices. A standard base line seems to be a supersonic buzzing starting at around mach 0.85, net trust dropping to 0 by about mach 0.90 and thrust going negative past that. Altering the forces is pretty easy using atmCurve{} and velCurve{}. Making sure the engine still draws power is a bit more difficult. I solved the problem with atmosphere drop off by using atmosphereCurve{} like so. name = ModuleEnginesFX ... atmosphereCurve { key = 0 800 0 1000000 key = 0.000001 0 0 0.3012048 key = 0.5 789.496 0.02686068 0.02686068 key = 20 960 0 0 } // Jet params ... atmCurve { key = 0 0 0 0 key = 0.000001 0 0 0.3012048 key = 0.5 0.98687 0.02686068 0.02686068 key = 20 1.2 0 0 } So that force and efficiency drop at the same time and at the same rate. I would like to do the same thing with velocity. Here's what I tried: name = ModuleEnginesFX ... velocityCurve { key = 0 600 0 0 key = 0.5 800 0 0 key = 0.85 400 -2.125082 -29.05206 key = 1 800 0 0 } // Jet params ... velCurve { key = 0 0.75 0 0 key = 0.5 1 0 0 key = 0.85 0.5 -2.125082 -29.05206 key = 1 -1 0 0 } But the game doesn't recognize velocityCurve{} as anything even though I'm fairly sure I've seen it used before. (can't remember where) As is the game follows velCurve{} by changing the flow of electricity rather than engine efficiency. However it makes no sense to have the propeller tips experiencing extreme supersonic drag at mach 0.90 but not requiring any power to keep moving and even less sense to have the propeller creating drag similar to a 1m parachute at mach 1 and actually be producing electricity. Is there something small I'm missing in syntax, am I way off the mark, or is this idea impossible using base game mechanics? Here's the whole module: MODULE { name = ModuleEnginesFX thrustVectorTransformName = thrustTransform exhaustDamage = False ignitionThreshold = 0.1 minThrust = 0 maxThrust = 50 heatProduction = 8 useEngineResponseTime = True engineAccelerationSpeed = 20 engineDecelerationSpeed = 20 //useVelocityCurve = True EngineType = Turbine PROPELLANT { name = ElectricCharge ratio = 0.4 DrawGauge = True } PROPELLANT { name = FSCoolant ignoreForIsp = True ratio = 0.01 } atmosphereCurve { key = 0 800 0 1000000 key = 0.000001 0 0 0.3012048 key = 0.5 789.496 0.02686068 0.02686068 key = 20 960 0 0 } // Jet params atmChangeFlow = False useVelCurve = True useAtmCurve = True flameoutBar = 0.001 flowCapMult = 1.0 machHeatMult = 10 atmCurve { key = 0 0 0 0 key = 0.000001 0 0 0.3012048 key = 0.5 0.98687 0.02686068 0.02686068 key = 20 1.2 0 0 } velCurve { key = 0 0.75 0 0 key = 0.5 1 0 0 key = 0.85 0.5 -2.125082 -29.05206 key = 1 -1 0 0 } }
  11. Snark Sounds like it might be a good idea. I'll give it a try. Thanks
  12. Your're talking to me as if i'm asking how to make a space plane. Yes, I understand how the engine mechanics work, and they work perfectly for rockets, and are a decent approximation for jets. I, however, am making a propeller engine, which should dramatically lose thrust past mach 0.85, produce no net thrust at about mach 0.90 and produce negative thrust past mach 1; all while the engine is at full throttle. I can do this with the velCurve, but it changes force by making the engine use less electricity, not by making it less efficient. An engine at full throttle using no electricity (mach 0.90) makes no sense, and an engine at full throttle producing excess electricity while it should be breaking apart (mach 1) makes no sense either. My question was: is there a way to alter engine efficiency over velocity or is it impossible using stock game mechanics?
  13. I'm altering the config file on an electric aircraft propeller, and was almost done. So I want specific impulse on the engine to be dependent on velocity so that I can force a constant fuel flow and still get a sharp drop off in force past mach 0.85 as if the propeller tips are going super sonic. I did a similar thing with Atmosphere here. name = ModuleEnginesFX ... atmosphereCurve { key = 0 800 0 1000000 key = 0.000001 0 0 0.3012048 key = 0.5 789.496 0.02686068 0.02686068 key = 20 960 0 0 } // Jet Params ... atmCurve { key = 0 0 0 0 key = 0.000001 0 0 0.3012048 key = 0.5 0.98687 0.02686068 0.02686068 key = 20 1.2 0 0 } Basically force and isp drop off equally with altitude so that the fuel flow remains the same, but the engine is less effective as air gets thinner. I tried doing a similar thing with velocity using: name = ModuleEnginesFX ... velocityCurve { key = 0 600 0 0 key = 0.5 800 0 0 key = 0.85 400 -2.055445 -10.22015 key = 1 0 0 0 } // Jet Params ... velCurve { key = 0 0.75 0 0 key = 0.5 1 0 0 key = 0.85 0.5 -2.055445 -10.22015 key = 1 0 0 0 } But it seems the game recognizes velCurve but doesn't do anything with velocityCurve Is my syntax a little off, or am I completely off the mark, or is this impossible? Here's the whole module: MODULE { name = ModuleEnginesFX thrustVectorTransformName = thrustTransform exhaustDamage = False ignitionThreshold = 0.1 minThrust = 0 maxThrust = 50 heatProduction = 8 useEngineResponseTime = True engineAccelerationSpeed = 20 engineDecelerationSpeed = 20 useVelocityCurve = True EngineType = Turbine PROPELLANT { name = ElectricCharge ratio = 0.4 DrawGauge = True } PROPELLANT { name = FSCoolant ignoreForIsp = True ratio = 0.01 } atmosphereCurve { key = 0 800 0 1000000 key = 0.000001 0 0 0.3012048 key = 0.5 789.496 0.02686068 0.02686068 key = 20 960 0 0 } velocityCurve { key = 0 600 0 0 key = 0.5 800 0 0 key = 0.85 400 -2.055445 -10.22015 key = 1 0 0 0 } // Jet params atmChangeFlow = False useVelCurve = True useAtmCurve = True flameoutBar = 0.001 flowCapMult = 1.0 //machLimit = 2 machHeatMult = 10 atmCurve { key = 0 0 0 0 key = 0.000001 0 0 0.3012048 key = 0.5 0.98687 0.02686068 0.02686068 key = 20 1.2 0 0 } velCurve { key = 0 0.75 0 0 key = 0.5 1 0 0 key = 0.85 0.5 -2.055445 -10.22015 key = 1 0 0 0 } }
×
×
  • Create New...