Jump to content

Ippo

Members
  • Posts

    1,349
  • Joined

  • Last visited

Everything posted by Ippo

  1. Uh, ok... I'm not quite sure how this kind of things are handled, sorry Basically, I just want to have my plugin to start execution when the game is loaded and stop when the player exits a save and goes back to the main menu. With your solution my scenario module will be re-instantiated at every scene, is that correct?
  2. Well, no, I'm sure there is only one dll. Also, I only get 2 instances when I set it to startup in every scene, but only 1 when I startup in the KSC. Anyway, I'll take your suggestion and use the improved version Thank you!
  3. Hello, I'm making a partless plugin derived from ScenarioModule. I want it to start at every scene "in game", as in only those that are accessible when a save file is loaded. So I set the KSPAddon attribute like this: [KSPAddon(KSPAddon.Startup.EveryScene, false)] public class CrewFiles : ScenarioModule { ... } and then filter out the scenes I don't want by running my logic only when HighLogic says I'm in a scene I'm ok with. However, looking at the log my addon gets instantiated TWICE for each scene. If I set KSPAddon.Startup.SpaceCentre, then it's fine and only one instance is created. What am I doing wrong? Oo
  4. You are probably right... but I'm a fan of functional programming so LINQ gives me a raging *** enthusiasm and I would use it for everything ever
  5. You are probably right. I didn't give it too much though: "is it working? Ok I'm switching to the foreach"
  6. I'm afraid I don't have it anymore, I didn't commit it until I got it to load. Anyway, it doesn't crash KSP: it just won't be loaded. So KSP works just fine, but your plugin is ignored. Using .NET 4.5 the assembly won't load it at all with the code in my post above; Using .NET 3.5 it gets loaded: but for some reason, it doesn't work (as in, it finds no types with my custom attributes even when I'm sure there are); Using .NET 3.5 and refactoring that neat linq to two hideous foreach loops makes it work as expected: private void FindAllCrewDataGenerators() { this.Generators = new List<Type>(); foreach (AssemblyLoader.LoadedAssembly asm in AssemblyLoader.loadedAssemblies) foreach (Type t in asm.assembly.GetTypes()) if (Attribute.IsDefined(t, typeof(CrewDataGenerator))) this.Generators.Add(t); }
  7. I'm having some problems with reflection. I'm trying to find all the types that have an attribute that I define. I am using this code: private void FindAllCrewDataGenerators() { var generators = from type in AssemblyLoader.loadedTypes where Attribute.IsDefined(type, typeof(CrewDataGenerator)) select type; this.Generators = generators.ToList(); } where CrewDataGenerator is my custom attribute. However, with this method defined my assembly won't load. In the output log I find this: I asked in the IRC channel: can't use linq, need to target .NET 3.5. Thank you!
  8. I did notice Anyway, I wanted to read in the full list of hired and applicant kerbals, but that was before I found out the proper way to get them using HighLogic
  9. It says so on the wiki: http://wiki.kerbalspaceprogram.com/wiki/Category:KSP.IO_Namespace All the classes used to provide filesystem I/O in KSP in lieu of System.IO, which is a Forbidden Namespace.
  10. 1) ModStatistics is the most used mod of all! (... obviously: maybe it makes sense to hide it?) 2) Why are the correlation data hidden? I remember I could see the correlation for each mod some days ago, now I can't anymore. Did I miss something? 3) How's the correlation computed anyway? 4) Honestly, I really believe this should be either opt-in or have the popup on the first run. I know that you already answered to this point, but well, just my 2 cents. The average user won't bother reading the license, and I can see many users that will literally lack the skills to opt-out. All in all, I'm not against the general idea, but as it is right now many users will submit data without knowing and I don't think it's fair.
  11. Quick dev update for the interested: Right now, development is essentially stopped because I have an exam soon. Anyway, this short pause will be very good: I have many cool stuff in mind right now, and I need to sort my thoughts out Basically, I am trying to get a clear conceptual design of: - inspections vs pre-emptive maintenance - decaying performance (where applicable, like solar panels and RTGs) - a new, huge feature that I'm quite not ready to announce yet because I need more infos and tests to be sure I can pull this off So stay tuned, more goodies are coming (also, one of these nights I'll take the time to write the module for EngineFX, it's stupid that half of the engines are immune right now).
  12. To be totally honest: I am not quite sure either. As far as I know, they should only happen on active vessels: remember though that when you get within 2.5km they become active. I need to run more tests on this. Sorry for the noobness, it's really my first mod ever and KSP has no documentation :/ ... sorry, I guess? Are you still using the cgfs from the alpha 2? Because I realized that all those values were absurd, so I gave everything one hell of a buff in this new update. If you did upgrade, though... then it's just bad luck This mod is inherently about a good dose of luck* * that's actually not a joke: even if the MTBF is 10 thousand hours, it's not impossible that two failures happen one immediately after the other. Just very unlikely. By the way, this made me realize that this is a huge BS outcome of my model: I will need to give an age discount for repair, too.
  13. Hello everyone, sorry for the necro, but I was wondering if it has been fixed since it's been almost a year or if Majir's fix still applies.
  14. UPDATE RELEASE This (Alpha 2.1) is a very small update that brings a much needed feature: blacklisting resources from other mods. Right now it supports the following 4 mods: Deadly Reentry Extraplanetary Launchpads TAC life support Station Science More will follow when I hear from some authors I contacted. Anyway it's very easy to add a resource to the blacklist if you feel the need to do it now: just open the DangItTanks.cfg file and add the line: ignore = ResourceName You can also use this module manager file if you prefer to do it this way: @PART:HAS[ModuleTanksReliability]:AFTER[DangIt] { @MODULE[ModuleTanksReliability] { ignore = ResourceName } }
  15. Hey nathan, just letting you know that the source code link gives me a 404.
  16. THIS. The examples by Taranis are incredibly useful.
  17. Hi again, sorry for the spamming. 1) Is it possible to read/write a list in config nodes? It is, and it's very easy. Assuming that your config file (or config node) looks like this: MYMODULE { mylist = value1 mylist = value2 ... mylist = valueN } then you can load all the values like this: List<string> myList = node.GetValues("mylist").ToList<string>(); 2) Is it possible to access the whole persistence file (read-only is fine too)?
  18. However, keep in mind that the whole idea of redundancy will do that in any case.
  19. I don't know about megajoules, but I could just reduce the MaxAmount of the battery.
  20. In the first release they were much higher. I felt it was a little OP... so now I erred on the opposite side. Personally I don't think it's fair that the same component has two different behaviours according to the crew's presence. However, when I'll finally get around to a proper balancing, parts will be heavily differentiated and I'll see that small parts (aka: stuff you use on probes) gets a boost. Sorry, not yet. I have an exam next week and time is a bit tight at the moment. Also, as of now the list is also hardcoded which means you can't edit it. Moving the black list to run time is literally the next thing I'm going to work on... but again, exams. Sure thing, go ahead! Those values are the maximum and minimum time constants for the resource leak, that is computed as an exponential. Lower values are worse for you: I think that the minimum of 60 is pretty much ok, the max is a tad too high right now (on the dev thread I've been told that with a TC of 233 the leak is barely noticeable without timewarping). Also please note that a bug has been found in the dev thread: the leak follow strictly the resource flow rules, so if you have more than one tank the resource is lost from the furthest available tank instead of the broken one. This doesn't affect gameplay, but it's still annoying. You should repair the broken one, even though it's not the one that is losing fuel (well, technically it is, but KSP automatically pumps in from the other tanks so it appears to remain full).
  21. However, it only works when the engines are off: if you are consuming fuel and re-assign the amount, the consumption is actually reduced, and not increased. Re-assigning the amount is only correct if the leak is the only flow in the tank.
×
×
  • Create New...