Jump to content

linuxgurugamer

Bug Hunter
  • Posts

    24,911
  • Joined

  • Last visited

Everything posted by linuxgurugamer

  1. For those interested, blackleg submitted some patches to fix the Petal adapter and the 5m interstage node. I just released 0.2.0 of the community patches
  2. I do use Autopruner, thanks. I was more interested in if the code for the fairing was in a separate DLL, and could be deleted.
  3. problems solved, now just waiting to hear from Zeenobit to see if he will be willing to add a simple function to Historian which i can call. Thanks all for your help LGG
  4. Crash Spashdown Cre Killed Cre on eva Flag Planting Launch Part couple Part die (explode) Joint breaking undocking activating stage stage seperation changing vessel making orbit escaping orbit SOI changed
  5. I've made changes to allow this mod to talk to Historian. I just need Zeenobit to add a function to Historian. Thanks for the suggestion. LGG
  6. Zeenobit, I've finished modifying my AutomatedScreenshots mod to be able to call your Historian mod. It requires a slight modification to Historian. Add the following function to the Historian.cs file: public void set_m_Active() { m_Active = true; } When this is there Automatedscreenshots can tell it that a screenshot is about to be taken. Also, if you could update the AssemblyInfo.cs file, and set the AssemblyVersion to: [assembly: AssemblyFileVersion("1.0.1.0")] It would make it easier for my mod to be sure the correct version is loaded and available. Also, and this is getting a bit deeper, if you could come up with a way for me to tell you the situation, that would be useful as well. Thanks LinuxGuruGamer
  7. yes, that did it. Now I have another problem, but that should be simple (I know, famous last words)
  8. I've been trying to get this reflection code working. This is the top of the Historian.cs file: namespace KSEA.Historian { [KSPAddon(KSPAddon.Startup.MainMenu, true)] public class Historian : Singleton<Historian> I have a modified copy of Historian, with the following added functions: public bool set_m_Active(bool m) { m_Active = m; return m_Active; } public bool get_m_Active() { return m_Active; } I have the following: public static bool get_m_active() { if (!historianAvailable) { Log.Info ("historian not available"); return false; } try { Type calledType = Type.GetType("KSEA.Historian.Historian, Historian"); if (calledType != null) { Log.Info("calledType: " + calledType.ToString()); return (bool)calledType.InvokeMember("get_m_Active", BindingFlags.InvokeMethod | BindingFlags.Public | BindingFlags.Static , null, null, null); } } catch (Exception e) { Log.Info ("Error calling type: " + e ); return false; } return false; } but I'm getting the following error: [LOG 17:09:26.356] AutomatedScreenshots: Error calling type: System.MissingMethodException: Cannot find method get_m_Active. at System.MonoType.InvokeMember (System.String name, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object target, System.Object[] args, System.Reflection.ParameterModifier[] modifiers, System.Globalization.CultureInfo culture, System.String[] namedParameters) [0x00000] in <filename unknown>:0 at System.Type.InvokeMember (System.String name, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object target, System.Object[] args) [0x00000] in <filename unknown>:0 at AutomatedScreenshots.Version.get_m_active () [0x00000] in <filename unknown>:0 Any ideas? Thanks
  9. Many big thanks to Sarbian, who identified the fact that the DLLs weren't being loaded in the right order. Quick fix was to add a z to the beginning of the directory name. - - - Updated - - - It was, Sarbian helped me on IRC. I now have it working using the KSPAssemblyDependency, but will be looking at your code since I think that would be safer. Thanks
  10. Ok, I'm officially frustrated :-) First, what I'm trying to do: Using Xamarin Studio I created a local copy of the Historian mod, and added a couple of public functions so that I can properly tell it when to activate. I have verified that it is built targeting "Mono/.NET 3.5" in the project options After building it, I manually copied the DLL into my dev install. I'm trying to access this from my AutomatedScreenshots mod. I have verified that it is built targeting "Mono/.NET 3.5" in the project options First, I added a reference to the Historian dll in the References Then, I added the following to the top of my file. There are two lines for Historian, I've tried it with each one by itself, and both together: using System.Reflection; using KSEA.Historian; using Historian; When I build with just the above addition, it builds and then runs properly. The only thing I tried to do is to create a private variable which will be used to get a pointer to the component. For now, the ONLY code I added is the following: private Historian historian; I'm getting the following error in the log : [LOG 13:29:22.986] PhysicsGlobals: Loading database [LOG 13:29:23.304] Load(Assembly): /ModuleManager.2.6.6 [LOG 13:29:23.353] AssemblyLoader: Loading assembly at R:\KSP_1.0.4_Dev\GameData\ModuleManager.2.6.6.dll [LOG 13:29:24.139] AssemblyLoader: KSPAssembly 'ModuleManager' V2.5 [LOG 13:29:24.139] Load(Assembly): 000_Toolbar/Toolbar [LOG 13:29:24.140] AssemblyLoader: Loading assembly at R:\KSP_1.0.4_Dev\GameData\000_Toolbar\Toolbar.dll [LOG 13:29:24.142] AssemblyLoader: KSPAssembly 'Toolbar' V1.0 [LOG 13:29:24.142] Load(Assembly): AutomatedScreenShots/Plugins/AutomatedScreenshots [LOG 13:29:24.143] AssemblyLoader: Loading assembly at R:\KSP_1.0.4_Dev\GameData\AutomatedScreenShots\Plugins\AutomatedScreenshots.dll [LOG 13:29:24.145] Load(Assembly): KSEA/Historian/Historian [LOG 13:29:24.145] AssemblyLoader: Loading assembly at R:\KSP_1.0.4_Dev\GameData\KSEA\Historian\Historian.dll [LOG 13:29:24.147] Load(Assembly): MinAmbience/MinAmbience [LOG 13:29:24.147] AssemblyLoader: Loading assembly at R:\KSP_1.0.4_Dev\GameData\MinAmbience\MinAmbience.dll [LOG 13:29:24.151] AssemblyLoader: Loading assemblies [ERR 13:29:24.173] AssemblyLoader: Exception loading 'AutomatedScreenshots': System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded. at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool) at System.Reflection.Assembly.GetTypes () [0x00000] in <filename unknown>:0 at AssemblyLoader.LoadAssemblies () [0x00000] in <filename unknown>:0 Additional information about this exception: System.TypeLoadException: Could not load type 'AutomatedScreenshots.AS' from assembly 'AutomatedScreenshots, Version=1.0.5690.22431, Culture=neutral, PublicKeyToken=null'. I'm obviously doing something wrong, but can't figure out what. I'm guessing it probably has to do with my unfamiliarity with the language. Help would be appreciated. Thanks in advance.
  11. Thanks, #1 works well. Although you do have a function to look for RemoteTech internal to the Version class #2 is silly as you said, since not only do I need to know if it's there, I need to be able to access a public function in it. The name of the public function will be known, as will the parameter list. I think I've figured it out, I will need to use the function GetComponent. Suggestions are useful, but (hopefully) not needed right now. Thanks
  12. I'm looking at the possibility of having my AutomatedScreenshots mod do something if the Historian mod is loaded. Right now they don't play well together (Historian doesn't know when I take a screenshot), and I'm looking into the possibility of having my mod tell Historian that a screenshot is in progress. So, I'm looking for an example of one mod detecting if another is installed, and if it is, then calling a public function in that mod. Thanks in advance LGG
  13. Hi Zeenobit, I just released a mod called Automated Screenshots It's been suggested that I see if I can interface with mods like yours. From what I understand, your mod doesn't actually do the screenshot, it just works with the screenshot code. Do you intercept the F1 key, or do you do something else internally? Please PM me if you want, it seems that our mods complement each other. Thanks LinuxGuruGamer
  14. Ummm, what other screenshot automation mods? The only one I'm aware of is Historian, and it doesn't do screenshots, it just puts captions on Not sure about the frame, I'm trying to keep this small and simple. But I will think about it. LGG
  15. With pleasure. Your mod was the inspiration for this. I'll get the code updated in a day or so JBB - - - Updated - - - This does NOT rename manual screenshots.
  16. FYI, since this is a beta, there are still some logging statements which aren't really necessary. Once I get some feedback, I'll be able to remove them. LGG
  17. As requested. It's done, download the latest. LGG
  18. Thanks. I decided to keep this as a separate class to make it cleaner, so I had to add two functions to get and set the flag: public bool isVisible() { return uiVisible; } public void setVisible(bool { uiVisible = b; } I had to add two functions, since my original code was copied from the main class of my mod. One thing though, the Awake function isn't being called, I have to call it myself from inside the main Awake function. Do I need to put something in front of this: public class UICLASS: MonoBehaviour
  19. I need to know whether the UI is being displayed or not. For now, I'm using the following code: public class UICLASS: MonoBehaviour { private bool uiVisible = true; private static KeyCode toggleUIKeycode = KeyCode.F2; public void Update () { if (Input.GetKeyDown (toggleUIKeycode)) uiVisible = !uiVisible; } } I'm sure there is a better way, since this will not work if there is another mod which issues the following calls: GameEvents.onHideUI.Fire (); and GameEvents.onShowUI.Fire (); So far, I haven't found it, and was hoping someone could point me in the right direction. Thanks in advance.
  20. Probably an early prototype of the massive computer that Earth was. Remember, the answer is 42, but they don't know the question
  21. There will be an update in the next few days, with a pre-crash detection mode, so that if you are about to land (crash), it will be able to take more frequent screenshots.
  22. Can you tell me what happened? If it's a problem with my config, I'd like to get it sorted out. Thx
  23. Thank you. For now, I have some saved ships which use the old part. While I could certainly rebuild them, it would be nice if I could just continue to use them, but right now I get the message that the ship contains experimental parts that aren't available right now. Is there anything I can do to get this working easily? I assume it could be as simple as a MM patch. If I get some time, I'll see if I can hand-edit the files, but due to the saved ships, there are a number of files. Thanks
×
×
  • Create New...