swebonny Posted March 5, 2012 Share Posted March 5, 2012 That looks incredibly tasty. I haven\'t booted up Visual Studio in a while, have mainly been working with Java. Quote Link to comment Share on other sites More sharing options...
NovaSilisko Posted March 5, 2012 Share Posted March 5, 2012 Is there a way to see if a part has a stage before it? I need to make this part not run its Active functions until the stage before it is gone. Quote Link to comment Share on other sites More sharing options...
skyline131313 Posted March 5, 2012 Share Posted March 5, 2012 Anyone know how to get the position and vector velocity of a vessel?vessel.orbit.getPositionAt(Planetarium.GetUniversalTime()) * Planetarium.InverseScaleFactor; That\'s what it seems to be but the values don\'t make sense pertaining to my current altitude. Quote Link to comment Share on other sites More sharing options...
toastar Posted March 5, 2012 Share Posted March 5, 2012 Is there a way to see if a part has a stage before it? I need to make this part not run its Active functions until the stage before it is gone.if (this.inStageIndex == StageManager.StageCount) {}This should check to see if the part is in the active stage. It looks like there are some other fancy stuff you can check in the stage manager. Quote Link to comment Share on other sites More sharing options...
NovaSilisko Posted March 5, 2012 Share Posted March 5, 2012 if (this.inStageIndex == StageManager.StageCount) {}This should check to see if the part is in the active stage. It looks like there are some other fancy stuff you can check in the stage manager.Well, it\'s not so much active stage as 'is this part exposed' or 'is this part the last part in its stage' Quote Link to comment Share on other sites More sharing options...
toastar Posted March 5, 2012 Share Posted March 5, 2012 Hrmm... Maybe this?foreach (Part counter2 in this.children) { if (counter2.isAttached) { } } Quote Link to comment Share on other sites More sharing options...
NovaSilisko Posted March 5, 2012 Share Posted March 5, 2012 Hrmm... Maybe this?foreach (Part counter2 in this.children) { if (counter2.isAttached) { } }I\'ll try it, thanks. Quote Link to comment Share on other sites More sharing options...
Splendid Posted March 5, 2012 Share Posted March 5, 2012 Anybody knows how to display pressure? Quote Link to comment Share on other sites More sharing options...
Zool Posted March 5, 2012 Share Posted March 5, 2012 I\'m starting work on a deploy-able balloon part. I\'ve got buoyancy working, but I want it to work like a parachute (deployable). Does anyone have an example of how to switch meshes like the parachute module?[mod]Do not talk about decompiling the game. I will not give you a second chance.[/mod]Anybody knows how to display pressure?ooh, I can help someone!this.staticPressureAtm & this.dynamicPressureAtmI\'m not sure if this is correct, but it seems to work for densityFlightGlobals.getAtmDensity(this.staticPressureAtm) Quote Link to comment Share on other sites More sharing options...
Zool Posted March 5, 2012 Share Posted March 5, 2012 Do not talk about decompiling the game. I will not give you a second chance. :-[ Quote Link to comment Share on other sites More sharing options...
ForumHelper Posted March 5, 2012 Share Posted March 5, 2012 I created an oxygen tank of sorts. I\'ve noticed that it gets used at the same pace, no matter what warp I use. How do I fix this? Quote Link to comment Share on other sites More sharing options...
swebonny Posted March 5, 2012 Share Posted March 5, 2012 I created an oxygen tank of sorts. I\'ve noticed that it gets used at the same pace, no matter what warp I use. How do I fix this?If it\'s possible, try to get the warp multiplier, and adjust the oxygen exhaustion rate accordingly.I\'m thinking something like. public void adjustExhaust(<T> theWarpFactor){ if (theWarpFactor is something) then set oxygen to certain speed something like this.oxygenRate = theWarpFactor*this.oxygenRate else do something else}Excuse my really shitty psuedo code. Quote Link to comment Share on other sites More sharing options...
ForumHelper Posted March 5, 2012 Share Posted March 5, 2012 @up I thought about it, but I can\'t find a way to get the warp factor. How can I kill the crew? Is there a KillCrew() function or something simillar? Quote Link to comment Share on other sites More sharing options...
Emilio Posted March 5, 2012 Share Posted March 5, 2012 How can I kill the crew? Is there a KillCrew() function or something simillar?What kind of plugin are you develloping ?... Quote Link to comment Share on other sites More sharing options...
ForumHelper Posted March 5, 2012 Share Posted March 5, 2012 I\'m going for a 'Oxygen tank' part just to see how complicated it is to implement something easy.Now, in order to do it, I need to know how to kill the crew and adjust the oxygen consumption when warp is used. Quote Link to comment Share on other sites More sharing options...
swebonny Posted March 5, 2012 Share Posted March 5, 2012 @up I thought about it, but I can\'t find a way to get the warp factor. How can I kill the crew? Is there a KillCrew() function or something simillar?Yes, I\'m quite sure I saw something like that. Try 'vessel.'. Quote Link to comment Share on other sites More sharing options...
ForumHelper Posted March 5, 2012 Share Posted March 5, 2012 Thanks, I\'ll see what I can find. Quote Link to comment Share on other sites More sharing options...
skyline131313 Posted March 5, 2012 Share Posted March 5, 2012 Anyone know how to access any hud elements? Perhaps changing and/or adding more waypoints in the navigation ball? Quote Link to comment Share on other sites More sharing options...
Zool Posted March 6, 2012 Share Posted March 6, 2012 Does anyone have an example of launching a UI of some kind? UnityEngine.GUI, console window, etc...? Quote Link to comment Share on other sites More sharing options...
swebonny Posted March 6, 2012 Share Posted March 6, 2012 Does anyone have an example of launching a UI of some kind? UnityEngine.GUI, console window, etc...?Try looking at r4am0n\'s and CardBoardBoxProcessor\'s MechJeb Autopilot. They have a GUI which you can see in their source code, you learn a lot by reading the code. Then we have Unity\'s own documentation: http://unity3d.com/support/documentation/ScriptReference/30_search.html?q=guiAnd some basic tutorial: http://unity3d.com/support/documentation/Components/GUI%20Scripting%20Guide.htmlHow you apply it to KSP you\'ll have to figure out yourself, or by help from other people\'s source codes. Quote Link to comment Share on other sites More sharing options...
TaTaRinBsB Posted March 6, 2012 Share Posted March 6, 2012 which program language i need use, to develop plugin...C++ or C sharp? Quote Link to comment Share on other sites More sharing options...
ForumHelper Posted March 6, 2012 Share Posted March 6, 2012 C# Quote Link to comment Share on other sites More sharing options...
dodrian Posted March 6, 2012 Share Posted March 6, 2012 What\'s the difference between:OnPartActivate, OnPartAwake, OnFlightStart, etc.?Basically, a part I\'m using needs to initialize some variables each time it\'s loaded. I\'m putting it in OnFlightStart at the moment, but I\'m getting some very strange behaviour which I think might be due to one of those variables not being properly initialized. Quote Link to comment Share on other sites More sharing options...
ForumHelper Posted March 6, 2012 Share Posted March 6, 2012 OnPartActivate - happens when you press Spacebar and the stage with your part is activated.OnPartAwake - I believe this is available when unpausing the game.OnFlightStart - this happens when you click 'Launch' in the VAB and the ship is placed on the launch pad.I\'m doing the initialization in onPartStart(); Quote Link to comment Share on other sites More sharing options...
dodrian Posted March 6, 2012 Share Posted March 6, 2012 onPartStart()... that\'s called whenever the part is loaded? So, putting it on the launch pad, switching to the vessel from the tracking station, etc? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.