royals
Members-
Posts
20 -
Joined
-
Last visited
Content Type
Profiles
Forums
Developer Articles
KSP2 Release Notes
Everything posted by royals
-
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
-
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)?
-
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!
-
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?
-
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
-
Welp, looks like that was it :facepalm: all good here now, thanks
-
Oh, I'm using 4.5.4... Could that be why? I'm gonna try to install that version and get back
-
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!
-
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.
-
(First of all I don't know if this is the right forum but I hope so) I know firespitter/KAX exists but how do they actually work (I'm too much of a C# noob so I can't really look at the source, even though that helps a bit)? I assume they change texture to a blurred one once the engine revs up, but before that, how do the parts rotate? Would like to make something similar but with a passenger jet engine so the fan blades start spinning, is that possible? Really appreciate all answers!
-
Does anyone know how airbrakes are set up?
royals replied to royals's topic in KSP1 Modelling and Texturing Discussion
Alright thanks a bunch! Now my only problem is the control surface doesn't rotate around the X axis (if I have done everything correctly). http://imgur.com/a/MgWle You can see here that the x axis is aligned... obj_ctrlSrf is just a game object because the actual mesh (Aileron object) isn't aligned right so I set obj_ctrlSrf as the transform. It seems more as if it rotates around the Z axis. Any advice or have I completely dun goofd? -
Does anyone know how airbrakes are set up?
royals replied to royals's topic in KSP1 Modelling and Texturing Discussion
Okay, thank you very much but how do they actually brake? Is that determined by the deflectionLiftCoeff? -
I'm making a couple of wings which are supposed to have airbrakes but I can't figure out how they work. MODULE { name = ModuleAeroSurface useInternalDragModel = True dragCoeff = 0.6 deflectionLiftCoeff = 0.38 ctrlSurfaceRange = 70 ctrlRangeFactor = 0.2 ctrlSurfaceArea = 1 actuatorSpeed = 20 transformName = Flap defaultActionGroup = Brakes liftingSurfaceCurve = SpeedBrake } Here's the code from C7's A.I.R.B.R.A.K.E.S part, does anyone know what this means? I get the same stuff that are on ModuleControlSurface but the rest doesn't really make sense to me. I guess actuatorSpeed is how quick it rotates out? What about transformName? Assuming they're empty game objects like thrustTransforms for engines, why is that needed? What direction do they point in? And how do you use dragCoeff? I can't find any documentation on this module so any help is really appreciated