Jump to content

MoreUmpf

Members
  • Posts

    36
  • Joined

  • Last visited

Everything posted by MoreUmpf

  1. Is there a way to add custom events like the ones provided by the GameEvents-class. I created two of my own events like so: [B]public[/B] static class CustomEvents { [B]public[/B] static EventData<ProtoVessel> [I]onStationCompleted[/I] = [B]new[/B] EventData<ProtoVessel>("StationCompleted"); [B]public[/B] static EventData<ProtoVessel> [I]onBaseCompleted[/I] = [B]new[/B] EventData<ProtoVessel>("BaseCompleted"); } But I still had no luck actually firing those events. This is how I add, fire and remove the events: [...] Debug.Log("Firing Station event"); // <-- appears in the log CustomEvents.[I]onStationCompleted[/I].[B]Fire[/B](FlightGlobals.ActiveVessel.[I]protoVessel[/I]); [...] [B]protected[/B] override void [B]OnStart[/B]() { Debug.[B]Log[/B](" OnStart called!"); // <-- appears in the log CustomEvents.[I]onStationCompleted[/I].[B]Add[/B]([B]new[/B] EventData<ProtoVessel>.OnEvent([B]OnStationCompleted[/B])); CustomEvents.[I]onBaseCompleted[/I].[B]Add[/B]([B]new[/B] EventData<ProtoVessel>.OnEvent([B]OnBaseCompleted[/B])); } [B]protected[/B] override void [B]OnDestroy[/B]() { Debug.[B]Log[/B]("OnDestroy called!"); // <-- appears in the log CustomEvents.[I]onStationCompleted[/I].[B]Remove[/B]([B]new[/B] EventData<ProtoVessel>.OnEvent([B]OnStationCompleted[/B])); CustomEvents.[I]onBaseCompleted[/I].[B]Remove[/B]([B]new[/B] EventData<ProtoVessel>.OnEvent([B]OnBaseCompleted[/B])); } [B]private[/B] void [B]OnStationCompleted[/B](ProtoVessel pvessel) { Debug.Log("OnStationCompleted called!"); // <-- does NOT appear in the log } [B]private[/B] void [B]OnBaseCompleted[/B](ProtoVessel pvessel) { Debug.Log("OnBaseCompleted called!"); // <-- does NOT appear in the log } As you can see I did everything like with the normal GameEvents but the firing just doesn't call my functions at all. There's not even an error message in the log. What have I done wrong and how can I fix it?
  2. Your starting Funds are set to 0. How are you able to build even anything? Other than that it's a nice little spaceplane to start out with
  3. As of 0.90 you are now able to remove Kerbals from the roster. I accidentally killed Jeb (shame on me ) so I removed him from the roster. When I tried to do a quicksave I got a NullReferenceException(in the debug log) which pointed at KSPAchievements, so I looked into the save file and searched for the ProgressTracking node. Seems like I completed some achievements with Jeb and maybe because of this the game tries to read some data from Jeb when saving the game but fails because I removed Jeb from the list. Is this a new bug or maybe a conversion problem because I played on an older save? Also is there a way to fix this because I can't save my game anymore .
  4. I haven't tested it but you might be able to do it by creating your own class extending the Game-class and setting the HighLogic.CurrentGame to the class you just created. The problem is that you wont be able to change the New-Game dialogue to contain your new game mode, so you will have to find another way for the player to select your mode. The Game-class has a predefined enum called Modes which you will have to change in your extending class. Hope this helps.
  5. As for the colored font it isn't really a rule but it would much easier to read if you would just write as you just did. If you want to post any pictures(e.g. screenshots) you can upload them to image hosts and put the link in post between . A popular image host on this forum is imgur(it's free).
  6. If you attach the cargo bay to another one of these Mk2 parts you can attach parts to the middle point between cargo bay and Mk2 part. And if the your cargo doesn't exceed the 1.25m mark you wont be able to see it from the outside. Besides that please only use special text colors in your forum posts if you want to highlight something...
  7. Besides Visual Studio and MonoDevelop I can also recommend SharpDevelop which is free too. There is a Wiki page that shows the differences between these IDEs and also some links to useful tutorials.
  8. I haven't tested it but the RCS-LED changes it's state depending on this object: FlightGlobals.ActiveVessel.ActionGroups[KSPActionGroup.RCS]
  9. What is the exact difference between a ProtoPart and a ProtoPartSnapshot? And is a normal Part always present(especially the partRef of a snapshot), also when the vessel is unloaded?
  10. Thanks, the GameEvents worked, but now I got another question: Is there a way to insert a new line into a string so when KSP draws the string it jumps to a new line whenever it reaches a certain point. Maybe some kind of special symbol.
  11. Is there a way to determine if the player is currently in the Mission Control scene? I saw this HighLogic.LoadedScene variable, but I don't know how to use it.
  12. I don't think the giant B9 square-parts are meant to be flown like airplanes. You can build giant space cruisers out of them, but these only fly in space (obviously).
  13. No helmet on the mün? seems legit
  14. The models are looking good already, but the texures still need improvement as they are not really fitting together nicely.. Especially pic 7 looks awfull texturewise . I hope they are still doing some improvements to this .
  15. Green Kerbalpoop. Seriously where do they dump all this sh*t during the missions?
  16. 80% builder , 20% modder When I'm playing KSP I'm spending most of the time in the VAB building a craft and optimizing it to a maximum, then testing and also most of the time reverting back to VAB for further optimization Also my current KSP install contains roughly 25+ mods because I always think that I could really enhance the gameplay with whatever mod I recently discovered.
  17. If you mean the decoubler bug of the 64-bit version, it has been fixed as of 0.24.1: @OP: Better graphics. When I look at all the other games that are using the Unity engine, most of them have really good graphics even compared to modern standarts, whereas KSP has some really outdated graphics.
  18. Well, this is what happened to my space center when doing the same thing:
  19. You can assign your methods to GameEvents to do this. To add your mehtods to the GameEvents use this in your Start or Awake method: GameEvents.onGameStateCreated.Add(new EventData<Game>.OnEvent(yourMethod1)); GameEvents.onGameStateLoad.Add(new EventData<ConfigNode>.OnEvent(yourMethod2)); You should remove the methods in your OnDestroy method like this: GameEvents.onGameStateCreated.Remove(new EventData<Game>.OnEvent(yourMethod1)); GameEvents.onGameStateLoad.Remove(new EventData<ConfigNode>.OnEvent(yourMethod2)); At last you have to create the two methods yourMethod1(Game game) and yourMethod2(ConfigNode node), where "game" and "node" are the objects that the GameEvent returns.
  20. Ok thanks, since I was doing this all in an ContractParameter-class I just used the OnUpdate()-method to check if the time has elapsed.
  21. I have a Process which takes several Kerbindays to complete. To check if the Process has finished I calculated the universal completion time but now I don't know if there is something like a GameEvent which could trigger at the given time or if I have to check on my own if the time has elapsed...
×
×
  • Create New...