Jump to content

royals

Members
  • Posts

    20
  • Joined

  • Last visited

Reputation

0 Neutral

Profile Information

  • About me
    Bottle Rocketeer
  1. Duh. Thanks lol. Is there a thread or something somewhere with things that mod developers should know, considering the update? What with the move to Unity 5 and all that, or is everything basically the same?
  2. Alright, that helps a lot, thank you. Didn't know that about TWR actually, but now that I think about it it seems pretty obvious. I actually looked at your source code for TWR1 and I got some *cough*inspiration*cough*. Well anyway, I was just loading my craft and nothing happens, because the debug is getting filled with: "[Exception]: TypeLoadException: Could not load type 'Vector3d' from assembly 'Assembly-CSharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.". Any idea why this happens? I am using UnityEngine and System, I have Assembly-CSharp and UnityEngine in my references, plus my CoM is set to type Vector3, not Vector3d. Thanks for taking the time to help me on this, I'll be sure to pay it forward once I get a lot better with C# Loading gif
  3. Thanks for the reply! thrustAvailable is right now just set to engine.maxThrust but it's wrong since maxThrust is set to 100 while I can get 115-120 kN of thrust at full throttle. The problem is I don't know how to calculate it. I know about the flaw in my formula, it's just I've tried so many different ways so now I decided to try that one. Also if I don't have any altitude restrictions or so, just solely go for TWR, the TWR can be 1.000 but I still get +3m/s vertical speed. Is vessel.getTotalMass() flawed or is it the localg that is wrong (9.81)?
  4. Hi, been busting my ass for the last 6 hours trying to get my code, making a single engine craft hover, to work. I've tried like 7 methods on how to make it hover around a target altitude, but it just isn't stable enough (the methods make the altitude vary between everything from 10 meters to 200). I need some sort of formula to set the throttle, and I've tried so many I can't even remember them. The latest one I have tried is: throttle = (1 / (currentAlt / targetAlt)) * ((vesselmass * localg) / thrustAvailable); But it is very unstable, craft goes up and down a lot. Has anyone done something like this before and can help me out? Also, MechJebs KEEP VERT is unstable too, so can't borrow anything from there. Also why doesn't this work? It's the same way (or very close to how) it's done by MechJeb. (Vector3d)CoM = vessel.findWorldCenterOfMass(); (float)localg = FlightGlobals.getGeeForceAtPosition(CoM).magnitude; When I set localg this way, nothing works at all, I don't get any KSPEvents/Fields displayed, nothing. If I just set localg = 9.81f, it works. Thanks in advance!
  5. Is there any way to see what mode/difficulty the current game is in? Would like to use it in my plugins for creating a better experience. It could just be modes (sandbox/career/science) but preferably also difficulties (easy/normal/hard).
  6. Great thanks a bunch! Exactly what I need, much appreciated! But how do I see if my part actually has that module? I don't know how to use PartModuleList (part.Modules) but I assume it's that or something like it that I should use?
  7. Looked at firespitter's source and if I use AnimationState's time and speed variables, I can set time to 1 and speed to -1 to reverse it. It isn't the most pretty but it does the job at least.
  8. Alright thanks but I figured it out, used x = part.parent and then x.FindModuleImplementing<>(); What I'm now curious about is how about editing custom modules? UnityEngine doesn't include my class Foobar, so if I want to reference something in another module which I've made myself, how does that work? For example with engines I can say 'ModuleEngines x = blah blah' but I can't say 'Foobar x = ...' since neither System nor UnityEngine has that class. Must I add a "using x;" or how would I go about that?
  9. Is it possible to read and write module info of the parent part? Like if I have a custom module on part A which is attached to part B, can I retrieve/edit the info of a module on part B from the module on part A?
  10. How do KSP do animations? With ModuleAnimateGeneric, the animation plays till the end then reverses. I can't get this behaviour, I only get it to play to the end then it jumps back to the beginning and plays from there. How can I do this in my own module? Also parts like landing gears and legs: while in the editor, how can I get parts to jump directly to the end and beginning without playing the whole animation? Cheers
  11. Welp, looks like that was it :facepalm: all good here now, thanks
  12. Oh, I'm using 4.5.4... Could that be why? I'm gonna try to install that version and get back
  13. It feels like I'm spamming these forums but I just can't figure this one out. If I select my game object and open the animation tab, I can add clips but I don't see objects or anything like that: http://imgur.com/a/8KD0U As you can see my animation tab is empty. If I select the child of the game object, I can only see imported animation clips if I have any (can't add any then either, all options are disabled/greyed out). It also doesn't matter if I've imported animations from Blender... This is really irritating when I try to do emissive textures and stuff, I can click "add curve" when I've selected the "highest" parent and choose the emissive material in gameobject->mesh renderer->emissive color. But then when I change the value, nothing happens. I've seen videos where people change the values and the emissive parts light up but not for me :/ Sorry if I don't really explain it well, I'm tired and english isn't my native language but nonetheless, all answers are greatly appreciated!
  14. Heard about putting multiple textures into one file should save performance, is it as simple as putting all parts in one directory and using the same texture in Unity? So when you export it, the models are all looking for the same file? Or can you reference textures outside the model's directory? Sorry if this has been answered before, have searched the forum but couldn't find anything.
  15. Alright thanks a lot! MonoDevelop doesn't seem to complain but just to be sure should I define it as 'ModuleEngines x = part.FindMo...;'? I'm very new to this you see
×
×
  • Create New...