Slother Posted May 13, 2015 Share Posted May 13, 2015 Hi! I would like to know if i can use unity 4.6.5 to make a mod, because the ksp modding tutorial says i have to install a 4.3 versionThe current version of KSP (1.0.2) runs with Unity engine version 4.6.4f1, so I would suggest to get that one. Quote Link to comment Share on other sites More sharing options...
TheKutKu Posted May 13, 2015 Share Posted May 13, 2015 Other question: are the material in blender used in unity? Do i need to make an uv map? Quote Link to comment Share on other sites More sharing options...
CaptainKipard Posted May 14, 2015 Share Posted May 14, 2015 If I need to get information from a specific location on Kerbin (e.g. a vector from the location to the active vessel) do I need to use Kerbal Konstructs to place an object at the location? Quote Link to comment Share on other sites More sharing options...
Diazo Posted May 14, 2015 Share Posted May 14, 2015 If you know the location to place a Konstruct, do you know the Lat/Long?I believe that if you know the Lat/Long there are methods in the CelestialBody class to convert to a vector point.D. Quote Link to comment Share on other sites More sharing options...
CaptainKipard Posted May 14, 2015 Share Posted May 14, 2015 If you know the location to place a Konstruct, do you know the Lat/Long?I believe that if you know the Lat/Long there are methods in the CelestialBody class to convert to a vector point.D.OK cool. Yes I can find out the lat/long for those places, Thanks. Quote Link to comment Share on other sites More sharing options...
Kolago Posted May 15, 2015 Share Posted May 15, 2015 (edited) hsp is the mass specific heat of the resource, in kJ/tonne-K.So water has a 4.19 kJ/kg°C thats hsp = 4190 ?Source: http://www.engineeringtoolbox.com/heat-work-energy-d_292.html@RESOURCE_DEFINITION[Water]{ %hsp = 4190} Edited May 15, 2015 by Kolago Quote Link to comment Share on other sites More sharing options...
NathanKell Posted May 15, 2015 Share Posted May 15, 2015 Yep. Although that's what it has as a liquid, it'll change to steam at 373.15K (and to solid at 273.15K). Quote Link to comment Share on other sites More sharing options...
zengei Posted May 17, 2015 Share Posted May 17, 2015 Does anyone have any pointers in using the GeneratesHeat flag on ModuleResourceConverter? Specifically around controlling the amount of heat generated. The best that I can tell, the only other input into the system is a TemperatureModifier field, which appears to just be a dimensionless scalar multiplier. Is there anyway I can specify "This conversion produces x Joules of heat energy"?Specifically, I want to make some MM patches to convert the stock Fuel Cells to use CRP resources (Hydrogen, Oxygen, Water). That itself is straightforward, but I also want to generate heat as a byproduct, the question is how to accurately model that. On a related note, I also want to add Hydrogen and Oxygen "evaporator" converters to the fuel cells, which consume LqdHydrogen and LqdOxygen and produce Hydrogen and Oxygen respectively; again, that is straight forward, but I would also like to absorb heat from the part to do so, so I set GeneratesHeat to true and TemperatureModifier to a negative value, which seems to have the correct effect of lowering the part's temperature when the evaporator is active. That seems kind of hacky though, any potential pitfalls with doing that? Also, is there a way to control the flow of output resources so that any Hydrogen or Oxygen generated by the built-in evaporators can only be used by the Fuel Cell? Quote Link to comment Share on other sites More sharing options...
jamespicone Posted May 17, 2015 Share Posted May 17, 2015 The TemperatureMultiplier value is multiplied with the part's thermal mass, that's how many kilowatts of energy get added to the part.Which implies that a negative TemperatureMultiplier should work fine, but I don't know for sure.There are some other relevant KSPFields here - there's a HeatThrottle parameter that presumably controls whether or not the part slows down as it gets warm (or cold?) Quote Link to comment Share on other sites More sharing options...
cjones Posted May 17, 2015 Share Posted May 17, 2015 Hi,I am trying to make a mod that will change sounds for some of the stock engines and engines in other mods.I want to do this without overwriting files but all I have found on the internet regarding modifying sounds for engines involves placing the sound files inside the part folder. Is that the only way to do it? Is there no way to add sounds without having to modify original Squad folders and other mod folders? Ideally, I'd like to have my own mod folder with a bunch of sounds in it, and use Module Manager to change the sounds to mine if the parts exist. Quote Link to comment Share on other sites More sharing options...
TAz00 Posted May 17, 2015 Share Posted May 17, 2015 Hi, so I have this problem spawning parts: Notice the warp that happens just as physics enable? Anyone know what this is caused by? Vessel posistion, Protovessel posistion, orbit? something else entirely? Quote Link to comment Share on other sites More sharing options...
zengei Posted May 17, 2015 Share Posted May 17, 2015 The TemperatureMultiplier value is multiplied with the part's thermal mass, that's how many kilowatts of energy get added to the part.Which implies that a negative TemperatureMultiplier should work fine, but I don't know for sure.There are some other relevant KSPFields here - there's a HeatThrottle parameter that presumably controls whether or not the part slows down as it gets warm (or cold?)Thanks, I'll have to look into it some more, there seem be some more multipliers (HeatProduction, InternalHeatProductionFactor, etc.) that really confuse what the units of TemperatureModifier are meant to be (and thus what it would physically represent). But if the end result are kilowatts, then from my reading of the calcs, TemperatureModifier and the rest should multiply out to units of Kelvin.Also, is there a way to control the flow of output resources so that any Hydrogen or Oxygen generated by the built-in evaporators can only be used by the Fuel Cell?Answering, my own question here: from testing it out it appears that setting a FlowMode = NO_FLOW on the OUTPUT_RESOURCE produces the intended effect. Quote Link to comment Share on other sites More sharing options...
TAz00 Posted May 23, 2015 Share Posted May 23, 2015 I have a followup to my question.When loading vessels on the launch platform, the posistion can change whether you launched it, or came from the space center. (slight ...)this.part.vessel.GetTransform().posistion is -12,8 0 8 when launching vessel from vabthis.part.vessel.GetTransform().posistion is 0 0 0 when returning to same vessel on launchpad from Space CenterHow can i always get the first position result? Quote Link to comment Share on other sites More sharing options...
pellinor Posted May 23, 2015 Share Posted May 23, 2015 I have a followup to my question.When loading vessels on the launch platform, the posistion can change whether you launched it, or came from the space center. (slight ...)this.part.vessel.GetTransform().posistion is -12,8 0 8 when launching vessel from vabthis.part.vessel.GetTransform().posistion is 0 0 0 when returning to same vessel on launchpad from Space CenterHow can i always get the first position result?I suppose the transform of the vessel is the transform of the root part? There seems something buggy about this object on load vs launch (launch seems fine, on load TweakScale has problems with it, looks like mod code is executed before it is set up correctly). If it gives a zero value, you might get what you expect if you read it later. Quote Link to comment Share on other sites More sharing options...
TAz00 Posted May 24, 2015 Share Posted May 24, 2015 Thanks, how much later?The ship is waiting on the pad, untill I click the parts' right click menu to read the position. Quote Link to comment Share on other sites More sharing options...
Diazo Posted May 24, 2015 Share Posted May 24, 2015 Can you give other parts the ability to see their position on the right-click menu?If so, those should be non-zero and would have values in them.I ask because AFAIK, when you spawn a new flight scene, the vessel (so root part) is placed at world position 0,0,0 but that immediately starts changing as Kerbin is rotating. So depending on how long after the flight scene starts that you right-click the menu to see the location I would expect you to get different values displayed.Also note that vessel.GetTransform().position simply returns the position of the root part of the vessel, there is no actual vessel object to get a position of. (It may also use the current ControlFromHere part, I'm not 100% sure which.)D. Quote Link to comment Share on other sites More sharing options...
DMagic Posted May 24, 2015 Share Posted May 24, 2015 Hey guys, a simple one here - where do I find the default settings for starting a new career/science mode game? I'm looking to force the startup science to a certain amount. Couldn't find the relevant section in the API. ThanksCheck in GameParameters, it holds all of the difficulty settings. The sub-class CareerParams has most of the relevant career mode options (rewards, science, starting amounts, etc...).GameParameters.GetDefaultParameters() will give you the the default parameters for a given game type and difficulty level. Quote Link to comment Share on other sites More sharing options...
pellinor Posted May 24, 2015 Share Posted May 24, 2015 Thanks, how much later?The ship is waiting on the pad, untill I click the parts' right click menu to read the position.Oh, ignore me then. My idea was about strange behavior while loading the ship. Once you see it on the pad and can use right click menus everything should be fine. Quote Link to comment Share on other sites More sharing options...
TAz00 Posted May 24, 2015 Share Posted May 24, 2015 Can you give other parts the ability to see their position on the right-click menu?If so, those should be non-zero and would have values in them.I ask because AFAIK, when you spawn a new flight scene, the vessel (so root part) is placed at world position 0,0,0 but that immediately starts changing as Kerbin is rotating. So depending on how long after the flight scene starts that you right-click the menu to see the location I would expect you to get different values displayed.Also note that vessel.GetTransform().position simply returns the position of the root part of the vessel, there is no actual vessel object to get a position of. (It may also use the current ControlFromHere part, I'm not 100% sure which.)D.The thing is, that when I launch from VAB, everything works perfectly over and over. Leave it on the launchpad, goto spacecenter and come back, the position is now calculated with the wrong result. Same ship, hasn't moved an inch on the pad ( i realize it moves in relative terms because its a sphere, but my readouts are constant the first time).I actually use this.part.transform.position to get the position I want, and create a new transform from that + a small vector offset. It just dosn't return the same result =/ Quote Link to comment Share on other sites More sharing options...
Crzyrndm Posted May 24, 2015 Share Posted May 24, 2015 That's because the origin point (0,0,0) isn't fixed in space. From what you're saying, it initialises slightly differently depending on how you transition to the scene (and is constantly shifting in flight)This may helpFloatingOrigin.Offset Quote Link to comment Share on other sites More sharing options...
TAz00 Posted May 24, 2015 Share Posted May 24, 2015 Thanks, Looking at it, I get the following:#Working (Launch Scene)origin = "(-278.3, -3.2, -351.4)"this.part.transform.position = "(-5.2, 0.0, 3.6)"#Incorrect (Resume Flight Scene)origin = "(-280.4, -3.1, -350.0)"this.part.transform.position = "(-3.1, 0.0, 2.1)"#Working (New Launch Scene)origin = "(-278.3, -3.2, -351.4)"this.part.transform.position = "(-5.2, 0.0, 3.6)"Pretty consistent, yet the differences don't seem to add up, can you elaborate on its function? Same process, different vessel, looks like this: Quote Link to comment Share on other sites More sharing options...
Crzyrndm Posted May 24, 2015 Share Posted May 24, 2015 (edited) From those numbers: origin + position = (-283.5, -3.1, -347.9) or (-283.5, -3.2, -348.0)I find it likely the slight difference would disappear if you printed the result after adding the two Vectors together (much less rounding involved)I believe FloatingOrigin.Offset gives the location of the origin relative to the last origin (other than after scene load, the magnitude is always 6000 which is the distance the origin shifts while krackensbane is not engaged) when it is shifted.All the difference demonstrates is that the origin initialises differently depending on how you enter the scene which is why the part position is slightly different Edited May 24, 2015 by Crzyrndm Quote Link to comment Share on other sites More sharing options...
sarbian Posted May 24, 2015 Share Posted May 24, 2015 You have to understand the game use multiple coordinate system. The 0 moves around and is centered on the ship on load. The difference between your test may comes from the rotation too.The question is : what are you trying to do ? If you want to move relative to a part position then Vector3 offset = new Vector3( 1, 0 ,0);Vector3 worldPosition = part.transform.TransformPoint( offset );That will give your a position relative the the local coordinate system of the part to a world coordinate system.Have a look at http://docs.unity3d.com/ScriptReference/Transform.html Quote Link to comment Share on other sites More sharing options...
TAz00 Posted May 24, 2015 Share Posted May 24, 2015 (edited) You are indeed completely right Crzyrndm. The difference is gone (should've seen that)sarbian, that is exactly what I'm trying to do, but it should also follow the parts rotation, so it spawns in precisely the same spot relative to the part each time. I'll take a look at it.*editVector3 worldPosition = this.part.transform.TransformPoint(_spawnOffset);#ResumeworldPosition = "(-4.9, 0.0, -0.3)"#Load newworldPosition = "(-6.9, 0.0, 1.1)"#ResumeworldPosition = "(-4.8, 0.0, -0.3)"Relative to the part's system, should they not be static?Excuse my comments, no idea if they're right. Vector3 worldPosition = this.part.transform.TransformPoint(_spawnOffset); //Get launch transform posistions GameObject launchPos = new GameObject(); launchPos.transform.position = this.part.transform.position; launchPos.transform.rotation = this.part.transform.rotation; //Get Transform Transform launchTransform = launchPos.transform; //Extract ToAngleAxis data from selected spawning location launchTransform.rotation.ToAngleAxis(out angle, out axis); //TRANSFORM localRootPart posistion and apply offset _newConstructRootPart.localRoot.transform.Translate(launchTransform.position + _spawnOffset, Space.World); //TRANSFORM Rotate localRootPart in relation to root _newConstructRootPart.localRoot.transform.RotateAround(launchTransform.position, axis, angle); Edited May 24, 2015 by TAz00 Quote Link to comment Share on other sites More sharing options...
NathanKell Posted May 25, 2015 Share Posted May 25, 2015 They're static relative to the part. As sarbian says, the position of the origin changes. Five units right of the part will always be five units right of the part: relative positions are preserved. But absolution position is not preserved, because the very origin of the universe shifts (to avoid FP issues). Always rely on relative positions, not absolute positions. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.