Jump to content

Diazo

Members
  • Posts

    2,077
  • Joined

  • Last visited

Everything posted by Diazo

  1. @gift01 That is the same issue @A_name reported, but in my testing I can't replicate it as the mod shows distance to water in both modes on my computer. Where is this happening and are your running any mods? (Notably ones that change planets or the solar system.) D.
  2. Erm, it's actually supposed to show ASL when over the ocean even when in Surface mode. I'll have to see what broke. This is on Kerbin right? D. edit: Going to need more details, a quick test on Kerbin in the ocean right next to KSC shows behavior as expected. IE: When over the ocean, AGL and ASL mode show the same height, the distance to the ocean. It won't be quite the same because ASL shows distance from vessel CoM while AGL mode shows distance from lowest point on the vessel, but it will only be a few meters difference.
  3. This is all going to revolve around the Animation Time value. If there is also an Animate State enum like ModuleDeployableSolarPanel.deployState, that would probably also work. When ModuleAnimateGeneric.animTime =0f, animation is at it's "beginning" state, so in this case the converters are fully retracted. When it's 1f, they are fully deployed. Any other value between those two means the converter is actively deploying/retracting and the animation is playing. So: 1) Check .animTime ==0f or 1f, otherwise lock your code out. 2) .animTime = 1f, animation finished playing. 3) No clue, never looked at that. Not sure it's available as all ModuleAnimateGeneric does is tell the animation made in Blender to stop/start/reverse, I don't know how much information of the animation itself it exposes. D.
  4. Currently a Part is the actual object in the game world takes care of the model, collisions, rendering on-screen, etc. Then that Part is assigned different PartModules depending on what functionality you want. There is no limit to the number of partModuls a part can have which is how you get multi-function parts. The (part is StrutConnector) you are referring to is the old system where there were only Parts, no partModules, so a Part could only be one thing. This was a crippling limitation and so has been replaced by the partModule system where a Part is a Part, functions are enabled by giving it partModules. D.
  5. Pretty sure that there is a dedicated partMoudule for that, it's CModuleStrut or something I think? D.
  6. Not much that hasn't been mentioned for me. SpaceChem, World of Tanks, an X-Com Long War campaign that is proceeding glacially for ones already mentioned in the past few pages. Got The Talos Principle on the christmas sale and enjoying it so far. Also got Sublevel Zero and the first Dishonored but they haven't seen any playtime yet and Talos Principle's sucked me in so far (still on the first 'world' though). Also playing Kantai Collection (Japanese browser game) but not sure that counts as "gaming" as being talked about in this thread. D.
  7. Glad to be of assistance. One thing that really jumps out at me in all this is just how powerful IConfigNode is. I don't know that I'm going to go back and rewrite anything, but had I know about it at the time it would have made things a lot simpler in my own mods in a lot of ways. D.
  8. Yes, the mod must stay where it is as to load all the .actions files because I had to hardcode the location. As for changing the location I'd really rather not, I'm pretty sure doing so would cause issues with CKAN and the like so I'd rather not risk it. D.
  9. Okay, setting up a test on my end, it works. Part.cfg (I used the solarpanel as my test part) PART { name = solarPanels4 module = Part author = NovaSilisko mesh = model.mu rescaleFactor = 1 node_attach = 0.0, 0.0, 0.0, 1.0, 0.0, 0.0 TechRequired = advElectrics entryCost = 3800 cost = 380 category = Electrical subcategory = 0 title = OX-4L 1x6 Photovoltaic Panels manufacturer = Probodobodyne Inc description = The OX-4 is similar in design to the SP series solar panels, but without the heavy casing. Includes passive radiators on the reverse side for better heat dissipation. WARNING: Not retractable once deployed! attachRules = 0,1,0,0,1 mass = 0.0175 dragModelType = default maximum_drag = 0.2 minimum_drag = 0.2 angularDrag = 1 crashTolerance = 8 maxTemp = 1200 // = 3200 bulkheadProfiles = srf thermalMassModifier = 2.0 emissiveConstant = 0.95 heatConductivity = 0.04 // 1/3 the default tags = array charge deploy e/c elect energ extend generat (light photo power solar sun track unfold volt watt MODULE { name = ModuleDeployableSolarPanel resourceName = ElectricCharge chargeRate = 1.64 retractable = false animationName = solarpanels4 secondaryTransformName = panel3 } MODULE { name = ICFNTest testCurve { key = 3 15 key = 4 20 key = 5 25 } } } ICFNTest is the partModule I'm using to test, it contains just the following: public class ICFNTest : PartModule { [KSPField(isPersistant = false)] public FloatCurve testCurve = new FloatCurve(); public void Start() { Debug.Log("CFNTest " + testCurve.Curve.length); foreach(Keyframe ky in testCurve.Curve.keys) { Debug.Log("CFNTest2 " + ky.time + "|" + ky.value); } } } This prints the 3 key values to the log file: [LOG 20:29:12.921] CFNTest 3 [LOG 20:29:12.921] CFNTest2 3|15 [LOG 20:29:12.922] CFNTest2 4|20 [LOG 20:29:12.922] CFNTest2 5|25 So I'm not sure what is going on at your end at this point. D. edit: Looking at the code in your previous posts, can you get rid of the "//" note after ThrottleISPCurve? I think it's reading the trailing spaces as part of the name and so when it tries to load, the FloatCurve ThrottleISPCurve in code does not match "ThrottleISPCurve " in the part.cfg file.
  10. Vessel Type is an enum so it's locked. You'd have to completely replace the vesseltype system with a plug-in mod that completely replaced that functionality. A pretty big undertaking for something that would not be a big change really. D.
  11. Did you ever try: [KSPField] public FloatCurve ThrottleISPCurve = new FloatCurve(); I just looked at Near Future and that mod loads FloatCurves without any of the extra stuff you're having to do, just with the KSPField tag and nothing else. I can't see anything else it does different then the original test we tried. https://github.com/ChrisAdderley/NearFuturePropulsion/blob/21cbf5fd6018e042b1a372bf10d62f4fc47a860d/Source/VariablePowerEngine.cs D.
  12. If you open the console (Alt-F12), are their any errors being generated? You can also upload the output_log.txt for me to look at to see if I can spot anything. (It's in the KSP_x64_Data sub-directory in KSP.) D.
  13. @Red Iron Crown Yes it does, thank you. Happy new year all. D.
  14. It's actually pretty straightforward, I'll pm you the code snippet you need to add, it will only be about 10 lines of code. D.
  15. So to link to the ThrottleISPCurve, you had that sub-node in your part.cfg right? //Rest of Part.cfg file snipped MODULE { name=MyTestModule ThrottleISPCurve { key = 0 1 key = 1 100 } } As for a link to the configNode for a part, I've never found a good way to link to it so I just ended up doing my own lookup of it with the GameDatabase command linked in my last post. Now you would have to lookup the part.cfg location as you can't hardcode it if you are going to use it on multiple modules. I'm not sure where to get that but I'd start by looking at the model information to see if it's saved in there. Failing that, I would try to see if the ProtoPart has the information needed, you can look that up by partName. D.
  16. Version 1.4b Gituhub download. -Add Saturable Reaction Wheel momentum dumping via resource consumption. @Errol As requested. @santiagokof From our conversation back on December 7th, the actions for Extending/Retracting landing gear are included in this mod. (Not new in this version, just the first chance I've had to check.) Happy KSP'ing all. D.
  17. Not sure if technical questions on the forum go here, but is there anyway to see all watched threads with unread posts? I do have an Activity Stream setup to show only unread posts in threads I watch, but that shows each post. So when I have a popular thread (such as USI or FAR) watched, it pushes other threads off the page and I miss a lot of discussion this way. For those who use other forums, I'm asking for Xenforo's "Unread Watched Threads" view. Is this possible with the software we've got? D.
  18. Nice, that's just a bool value, very straightforward to do. Not sure what my schedule is the next few days due to new years though so we'll see. D.
  19. @Errol It isn't too hard really, I'd have to look at the code of the mod in question so I can hook the action into the button, but it's only about 5 lines of code. I also have an open offer to help other people out with actions and actiongroups if the mod is being actively maintained and that might be able to get the action added into the other mod itself. D.
  20. Okay, I wasn't quite answering the question you'd asked. Now, I can't actually track 100% how things work, but let's start with a ModuleEngines as it does exactly this for an atmosphereCurve. Using the "liquidEngine24-77", in the part.cfg you have: MODULE { name = ModuleEnginesFX thrustVectorTransformName = thrustTransform exhaustDamage = True ignitionThreshold = 0.1 minThrust = 0 maxThrust = 16 heatProduction = 150 fxOffset = 0, 0, 0.01 EngineType = LiquidFuel exhaustDamageDistanceOffset = 0.12 PROPELLANT { name = LiquidFuel ratio = 0.9 DrawGauge = True } PROPELLANT { name = Oxidizer ratio = 1.1 } atmosphereCurve { key = 0 290 key = 1 250 key = 7 0.001 } } Note the "atmosphereCurve" sub-node. Note this engine uses ModuleEnginesFX, but that inherits from ModuleEngines so looking at the ModuleEngines partModule we have: [KSPField] public FloatCurve atmosphereCurve; Note the exact same spelling, what I think should happen here is that when KSP loads and process all it's KSPFields, it will take the atmosphereCurve sub-node in the part.cfg and load it into the atmosphereCurve FloatCurve in code for you. The issue is that I can't track how this happens so I'm not sure it will work without testing and I have nothing remotely similar setup on my IDE to actually test this with. Note that isPersistent is false so any changes to this floatCurve won't save, but it looks like it will work to load. If that doesn't work, the best case I can think of is to do it manually: ConfigNode EntirePartCFG = GameDatabase.Instance.GetConfigNode("MyModFolder/part"; //note that file extensions don't come in, this would find the file at GameData\MyModFolder\part.cfg as a confignode ConfigNode MyPartModule = EntirePartCFG.GetNode("MyPartModule"); //find our partmodule in the part.cfg file FloatCurve MyFloatCurve = new FloatCurve.Load(MyPartModule.GetNode("FloatCurveSubNode"); //load the floatcurve from file, use an existing engine's part.cfg for the formatting One very handy trick when working with confignodes is the ToString() method: Debug.Log(MyConfigNode); //prints a single line to the log with the name of the confignode Debug.Log(MyConfigNode.ToString()); //prints the entire contents of the confignode to the log so you can see exactly what is going on inside one. I think that gets you going now but let me know how it goes. D.
  21. To persist data in the save file OnSave and OnLoad are the methods you need. The node OnSave passes is the "same" confignode that gets passed to the OnLoad method. I say "same" because the confignode values will be identical strings, but they technically aren't the same C# object so you can't reference them that way. So you'd have to save your FloatCurve to the node in OnSave and re-create it in OnLoad. It would be a bit of code because ConfigNodes only accept string values. Now I'm not sure if Squads done the heavy lifting, if there is a FloatCurve save method that returns a ConfigNode it is just two lines of code: in OnSave: node.AddNode("NodeNameString",MyFloatCurve.Save()); in OnLoad: MyFloatCurve.Load(node.GetNode("NodeNameString")); If you want to load from a file on disk, format the file as a ConfigNode and pull it into KSP with the ConfigNode.Load() command. D.
  22. Oh, you're going to have to change the KSPEvent's visibility in code then. Something like this in the partModule: if(FlightGlobals.ActiveVessel.isEva) { KSPEvent.hide(); //pseduo-command, not actually valid } else { KSPEvent.show(); //more pseudo-code } So if a kerbal is being controlled, the KSPEvent is hidden, otherwise it shows. Can add checks for room to recycle and such here too. D.
  23. To not add it to the Kerbal you need to modify the MM patch you are using. I can't remember if it was in KSP 1.0 or 1.1, but they added "kerbal" and "flag" objects so MM scripts could affect those. You'll have to dig up the specifics yourself as I don't know them myself, but I know the functionality is there. D.
  24. What happens if you set externalToEVAOnly = false in the KSPEvent? Those two settings (guiActiveUnfocued and externalToEVAOnly) would be what I expect to control visibility of the event as you are trying to use it. D.
  25. Yes, the plug-in would be a partModule that you attach to the parts that can do this via MM (or in it's part.cfg if you're making the part). How clear are you on how the underlying KSP engine works? I think part of the issue is that MM does not do quite what you think it does. Notably how were you going to do this cryo thing at all without a plug-in? MM is for changing the default settings of part, it can't change settings of parts in flight. It can appear to change settings in flight as KSP will always use the most recent version of the "default" part, but settings in the save file will override it. (So settings that don't get saved can be modified by MM on parts spawned in flight.) So once you've spawned a part inflight, the currentAmount of the resource gets saved and it doesn't matter what you do with MM, the currentAmount in the save file will always override your MM changes. To make changes such as this that happen in flight requires a plug-in. D.
×
×
  • Create New...