Jump to content

xEvilReeperx

Members
  • Posts

    894
  • Joined

  • Last visited

Everything posted by xEvilReeperx

  1. And no suspicious log entries (other than the alert messages)? Very strange. I can't think of what would be using so much memory. I'll have a look tonight
  2. How long did you test it for? If you just loaded a game and watched it, it might be creeping up because ScienceAlert is creating a special version of the biome map for that planet which takes 10 - 40 seconds and happens every time you change SoI. Are there any exceptions or other log messages? Other than the biome map, there shouldn't be any allocations anywhere near that large and definitely not continuously for multiple minutes. I'll look into it if you have any more details
  3. I could add an option to ignore reports already onboard, sure. Is the minimum threshold not sufficient? Could you define "can't actually usefully do again"? SA takes your settings extremely literally to avoid surprises and to avoid dealing with various what-ifs that might happen to the results afterwards.
  4. Well it's saved me a lot of time, I'm surprised more people haven't tried it ... or is there a problem getting it to work? Let me know if I haven't explained something well in the manual, it was a bit of a rush job to get something out for feedback
  5. I was working on something along these lines when I had my eureka moment that lead to the birth of AssemblyReloader. Have a look at the WIP thread if you're interested, I'd love any feedback
  6. One of the first things almost everybody that writes a plugin for KSP discovers is that you're going to spend a lot of time restarting the game. It'd be pretty neato if you could just press a button and see your current version running in a few seconds, wouldn't it? This tool is designed to do that with a few restrictions. I've brain dumped most of the important details into the manual. If you find a bug, have a comment or suggestion and so on let me know. It's only been tested on Windows 7/32 bit KSP so far but there isn't any technical reason aside from coder goof that would prevent it from running on other systems as far as I know. Supported types: MonoBehaviour (w & w/o KSPAddon) PartModule ScenarioModule VesselModule Any type not blacklisted below Known Issues: None yet Planned Features (note: if your plugin contains any of these types, it won't be reloadable -- see manual): Contracts Strategies Kerbal experience traits Kerbal experience effects Parts (the type itself) InternalModules Undoubtedly I've forgotten some other types that need custom code Interface improvements This is meant to replicate stock behaviour as closely as possible, down to the order things are initialized. If you see something that doesn't seem right or behaviour is different when loaded by AssemblyReloader as opposed to the game's AssemblyLoader, let me know. Don't use it with a save you care about naturally, there's all kinds of potential to wreck things using this. Make a backup, quicksave before reloading, etc Download: Download Changelog: 1.0.2 (Nov 16 2015) PartModule.OnInitialize now called correctly for reloaded PartModules KSPAddons now created after all loaders have run EveryScene addons no longer created twice Fixed some serialization issues Added ApplicationLauncher button Fixed an issue that prevented Cecil from correctly resolving assemblies referenced by a reloadable plugin outside of the reloadable plugin's folder 1.0.1 Added check against KSPAddon-marked PartModules Fixed a bug that tried to access opcodes in method definitions that had no body Source: AssemblyReloader (GPLv3) ReeperCommon (dependency) (GPLv3) ReeperAssemblyLibrary (dependency) (GPLv3) ReeperLoader (dependency) (GPLv3) StrangeIoC (dependency) (APACHE license) Mono.Cecil 0.9.6 (dependency) (MIT/X11 license) License: GPLv3
  7. Nice eyes there NK, I didn't even notice . Yes I think that's the most likely issue
  8. Is there any more of the stack trace to go on? You usually see this kind of exception when something bad has happened in ScenarioModule.OnLoad and it's doubly-bad because any ScenarioModule that comes after yours won't be loaded. At a guess and with no other info, I'd say the ConfigNode you tried to load in ScienceFunding.GetConfig doesn't exist or doesn't have a node called SCIENCE_FUNDING_SETTINGS -- you try to use it immediately after loading it without checking that the file exists and without checking that it was loaded or has such a node, and it's out of your general try...catch so a NRE in there will unwind back to the caller (ScenarioRunner)
  9. It probably isn't destroying the parts, then. ShipConstruct ship = blah; foreach (var p in ship.Parts) UnityEngine.Object.Destroy(p.gameObject); If this doesn't solve it, I'll have a look myself in the morning
  10. You've basically nailed the problem. The parts are hanging around for each snapshot. Destroy them after you've captured a thumbnail
  11. Some steps to get the log based on your OS can be found here. Have you scanned the planet? ScienceAlert won't trigger alerts for experiment results that depend on biome if you haven't scanned your current location for biome info through SCANsat, if you have that option enabled. Try flipping it off for a moment. If that's not the issue then something deeper is going on since everything else sounds correct
  12. What is your filter method set to? I'd like a look at the log as well. No experiments at all are triggering alerts? Do you have SCANsat integration enabled? What is your filter method set to? Sure! That whole section needs to be rewritten but in the meantime if you can give me a 24x24 and 38x38 version (png or dds), I'll just swap the current sprite sheet file as a quick fix for you. Sorry for the delayed response by the way, it seems the forum subscription feature does not notify me half the time
  13. Are there any suspicious entries in your log? Are you sure you have your settings correct? Is the min threshold set low enough to trigger them?
  14. I thought something similar. Stuff that works in the editor suddenly doesn't work in KSP. You can use Unity's shared reference serialization object, though: public class SSTUConverter : PartModule { [Persistent] public ConverterRecipe recipe = ScriptableObject.CreateInstance<ConverterRecipe>(); public override void OnStart(StartState state) { base.OnStart(state); print("SSTUConverter.OnStart"); if (recipe != null) print("Recipe: " + recipe); else Debug.LogError("(No recipe)"); } public override void OnLoad(ConfigNode node) { base.OnLoad(node); if (node.HasNode("CONVERTERRECIPE")) ConfigNode.LoadObjectFromConfig(recipe, node.GetNode("CONVERTERRECIPE")); } } public class ConverterRecipe : ScriptableObject { [Persistent] private List<ConverterResourceEntry> inputs = new List<ConverterResourceEntry>(); [Persistent] private List<ConverterResourceEntry> outputs = new List<ConverterResourceEntry>(); public override string ToString() { return string.Format("Recipe: using {0}, you get {1}", string.Join(",", inputs.Select(i => i.Resource).ToArray()), string.Join(",", outputs.Select(i => i.Resource).ToArray())); } } public class ConverterResourceEntry { [Persistent] public string Resource = "default value"; } It looks a bit ugly because I took advantage of KSP's existing ConfigNode serialization to construct the recipe. The PartModule ConfigNode the above uses looks like this: MODULE { name = SSTUConverter CONVERTERRECIPE { inputs { item { Resource = Hydrogen } item { Resource = Oxygen } } outputs { item { Resource = Water } } } }
  15. You're making the assumption that the collider is on the same GameObject as a Part, but that's never the case. Instead, Parts are made up of a hierarchy of GameObjects. The top-level one contains logic (ex: PartModules) and rigidbody, then another as a child called model, then beneath that as children are GameObjects with Renderers, Animations, Colliders--all the other things that make up a Part and come from cloned instances of models from GameDatabase.databaseModel Just look upwards in the hierarchy: private Part GetPartFromCollider(Collider c) { return c.gameObject.GetComponentInParent<Part>(); }
  16. I wasn't talking models or textures, just the transform hierarchy into an equivalent blender skeleton. But okay then I haven't investigated it at all and wondered whether your current solution was because an exporter didn't work out or that you preferred it
  17. Have you considered writing a tool that exports the kerbal transform hierarchy into something like Blender instead of painstakingly doing animations by hand? That was my first thought when I saw that you'd already gotten the import-into-FSM part working
  18. This is interesting. How far did you get on that particular project? It seems to have been a while since you made any changes
  19. Anything is fine: bundling, linking thread, or even copying the relevant code into your plugin if you prefer
  20. This should get you there: [KSPAddon(KSPAddon.Startup.MainMenu, false)] public class WindowInstructor : MonoBehaviour { private const int PortraitWidth = 128; private const int PortraitHeight = 128; private KerbalInstructor _instructor; private RenderTexture _portrait; private Rect _windowRect = new Rect(250f, 250f, 128f, 128f); private Dictionary<GUIContent, CharacterAnimationState> _responses; private int _selectedResponse = 0; private void Start() { Resources.FindObjectsOfTypeAll<KerbalInstructor>() .ToList() .ForEach(instructor => print("Instructor: " + instructor.CharacterName + ", prefab: " + instructor.name)); _instructor = Create("Instructor_Gene"); } private void OnDestroy() { if (_portrait != null) _portrait.Release(); if (_instructor != null) Destroy(_instructor.gameObject); } private void OnGUI() { _windowRect = KSPUtil.ClampRectToScreen(GUILayout.Window(GetInstanceID(), _windowRect, DrawWindow, "Window Title", HighLogic.Skin.window)); } private void DrawWindow(int winid) { GUI.skin = HighLogic.Skin; GUILayout.BeginHorizontal(); { GUILayout.FlexibleSpace(); // to center portrait in case window stretches beyond portrait width GUILayoutUtility.GetRect(PortraitWidth, PortraitHeight); if (Event.current.type == EventType.Repaint) Graphics.DrawTexture(GUILayoutUtility.GetLastRect(), _portrait); GUILayout.FlexibleSpace(); } GUILayout.EndHorizontal(); _selectedResponse = GUILayout.SelectionGrid(_selectedResponse, _responses.Keys.ToArray(), 4); if (GUI.changed) _instructor.PlayEmoteRepeating(_responses[_responses.Keys.ToArray()[_selectedResponse]], 1f); GUI.DragWindow(); } private KerbalInstructor Create(string instructorName) { var prefab = AssetBase.GetPrefab(instructorName); if (prefab == null) throw new ArgumentException("Could not find instructor named '" + instructorName + "'"); var prefabInstance = (GameObject)Instantiate(prefab); var instructor = prefabInstance.GetComponent<KerbalInstructor>(); _portrait = new RenderTexture(PortraitWidth, PortraitWidth, 8); instructor.instructorCamera.targetTexture = _portrait; _responses = instructor.GetType().GetFields(BindingFlags.Public | BindingFlags.Instance) .Where(fi => fi.FieldType == typeof (CharacterAnimationState)) .Where(fi => fi.GetValue(instructor) != null) .ToDictionary(fi => new GUIContent(fi.Name), fi => fi.GetValue(instructor) as CharacterAnimationState); return instructor; } }
×
×
  • Create New...