Jump to content

MoreUmpf

Members
  • Posts

    36
  • Joined

  • Last visited

Reputation

6 Neutral

Profile Information

  • About me
    Rocketeer
  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
×
×
  • Create New...