Jump to content

Link Hogthrob

Members
  • Posts

    43
  • Joined

  • Last visited

Everything posted by Link Hogthrob

  1. Several good tutorials: http://gallery.artofgregmartin.com/tuts_arts/making_a_planet.html http://fc06.deviantart.net/images/i/2003/38/2/1/Planet_Tutorial.jpg http://fc07.deviantart.net/fs41/f/2009/036/e/0/Texturing_and_planet_tutorial_by_aRchAng3lZz.jpg
  2. It seems the crew is already completely deleted by the time onPartExplode() is called. So I create a copy of the crew in onFlightStarted instead. Now I can use them even after they\'re gone. BTW, I might throw a random name generator in there for the little kerbs, or even make a crew customization plugin.
  3. I am trying to get some info on the crew when my custom commandpod explodes and write it to a file. Here is my code: protected override void onPartExplode() { print('KIA!'); try { // file is comma delimited // name,data\n if (!File.Exists(hofFile)) File.Create(hofFile); string fileContents = File.ReadAllText(hofFile); // get list of crew KIA foreach (ProtoCrewMember pcm in KerbalCrewRoster.CrewRoster) { string crewman = pcm.KerbalRef.crewMemberName; print(crewman); print(pcm.name); print(pcm.courage.ToString()); fileContents += string.Format('{0},KIA,{1},{2},{3}\n', crewman, FlightGlobals.ActiveVessel.vesselName, DateTime.Now.ToString('MM-dd-yyyy'), FlightGlobals.ActiveVessel.missionTime); } File.WriteAllText(hofFile, fileContents); print('Crew HoF saved'); } catch (Exception) { // ignore } base.onPartExplode(); } It doesn\'t appear to be going through the crew list at all. I also tried FlightGlobals.ActiveVessel.GetVesselCrew to no avail. Can anyone help? I must say that this plugin development has left me clueless on numerous occasions. Stuff you think should work just doesn\'t (like playing an mp3 I added to the sounds folder).
  4. Majiir, Something like this might work. (I have not tested any of this, but its a standard Observer pattern scenario) UPDATE: Upon review this isn\'t quite right. I need time to think about it outside of work hours. Its close. Sorta. public interface IKSPPartCallback { void PartActivated(Part partThatWasActivated); void PartDestroyed(Part partThatWasDestroyed); } public class KSPPart : Part { static List<IKSPPartCallback> _callbacklist = new List<IKSPPartCallback>(); protected void Subscribe(IKSPPartCallback subscriber) { // add to list }; protected void Unsubscribe(IKSPPartCallback subscriber) { // remove from list }; protected override onPartActivate() { foreach (IKSPPartCallback part in _callbacklist) part.PartActivated(); } protected override onPartDestroyed() { foreach (IKSPPartCallback part in _callbacklist) part.PartDestroyed(); } } public class MyPart : KSPPart, IKSPPartCallback { public void PartActivated(Part partThatWasActivated) { // check if its the part you are watching } public void PartDestroyed(Part partThatWasDestroyed) { // check if its the part you are watching } }
  5. This is the first iteration, hopefully we will see some cleanup in later releases. But yeah its hard to figure out what works and what doesn\'t. I like your idea of a wrapper though. I will comment on that thread further.
  6. This may not be the proper forum, but it is a request and it does deal with plugins, so here goes... Visual Studio displays any XML comments you place before your classes, methods, etc. in object browser and intellisense. Makes it much easier for plugin developers to see what your objects and functions are for. Example: /// <summary> /// This method makes your ship explode. /// <summary> public void Boom()... Would display as: Your function specifics etc. Summary: This method makes your ship explode. It takes a little more time to document your code, but would be beneficial to the rest of us. Thank you!
  7. Awesome, thanks for the snippet and also the audio clips! I will put these in after work tonight. Now that we have sound, maybe I can figure out how to read 'Jeb\'s' emotions and add some more interesting stuff to a communication plug-in...
  8. 8) I would love to put some old NASA Apollo audio to this. (Or a close facsimile) If anyone knows how to play an audio clip at run time in Unity please provide some sample code.
  9. PiSA-D1 Countdown Decoupler (version 1.0) Pigs in Space Auronautics Inc., Link Hogthrob CEO and Captain of the Swinetrek License: Just take the code, it ain\'t that great. (PiS-PL?) In the vast reaches of space no one can here you scream (except Piggy and Dr. Strangepork). Scream out of boredom, not that I frighten easily... Between our stopover at the Vegan mud planet and Sally\'s Slop Shack on Delta Orionis, I threw together this complex contraption I call the Countdown Decoupler. Space Center starts the timer and in 10 seconds your rocket engines fire no matter how much your crew cries and screams with anxiety. Here are some screen shots for your enjoyment: Countdown Decoupler in the VAB Start of your flight Abort button (Space Center control only) The timer continues until you close it or it will close automatically after 30 seconds of flight time. Source code and downloads: http://dl.dropbox.com/u/2922725/CountdownDecoupler.zip
  10. I see some crew management objects and functions and was wondering if anyone has been able to monitor a crewman\'s emotional state? Also, does anyone know how to play an mp3 or wav audio clip in unity? I had the idea of making a comm system where you can hear their squeals, giggles, or screams depending on the crew\'s mental health and maybe add some for other events in the flight as well.
  11. Just stumbled upon this thread... I\'ve been writing code for a long time. BASIC and Logo as a kid and in high school. Pascal, FORTRAN, COBOL, Scheme, and C++ in college. Professionally, I did some Perl and Javascript in the mid 90s for websites. Then Powerbuilder in the late 90s. Started with C++ again for commercial windows apps in \'99. Have done some VB and VBScript. Started dabbling in C# in 2002 or 2003, then went full tilt .Net/C# at work in 2007. I have some DirectX experience and Managed DX, and just a tiny bit of mucking around in XNA. I am a Senior Software Engineer by title, but more of a Software Engineering Manager, since I am doing more management than code nowadays.
  12. Mine is the most handsome. And dashing. I would also say 'manly'. Don\'t forget macho.
  13. Has anyone put the Mun in orbit, then landed on it (same flight)? I want pics or it never happened!
  14. Very cool! Watch out that it doesn't careen off the launch pad or esplode.
  15. Link is not my regular screen name. When joining this forum, Pigs In Space was the first thing that popped into my head. I usually go by AtomicDogg. Don't know why, just like it. Other screen names are Hendo73 or other variants on my real name/data.
  16. If you wanted to get fancy, you could create a local repository of installed parts and old backup parts. Use a zip file and an xml. Then they could change back and forth whenever they wanted. I'm not familiar with the ionic zip dll but it probably has a way to get the list of files in the zip. The XML would act as a database to tell your app what is installed and backed up and how to match things with what folder/files in the zip. <installed> <part_name1/> <metadata_for_part/> <location>path</location> <replacement_for>backedup_part_name</replacement_for> </installed> <backup> <part_name1/> <metadata_for_part/> <zipfolder_name>path</zipfolder_name> <replaced_by>part_name</replaced_by> </backup>
  17. If you are overwriting, just quickly backup the original folder. Shouldn't require much code if its a .net application.
  18. How about this? May not be what you want but it is amusing.
  19. Here we have one of the many fine employees of KSP Mission Control Center. Dr. Beaker Kerman is the lead scientist on KSP's latest liquid rocket engine, the AWH (A.ccident W.aiting to H.appen) Mark XVII. The AWH's sixteen previous launch attempts have ended prematurely in fiery explosions, but we believe the Mark 17 will be THE engine that gets Kermen well past the launch platform. Doesn't Beaker just exude confidence and poise? Good luck sir! The people of Kearth are proud of your pioneering spirit.
  20. Request! I would love to see a Kerbal version of the Mercury astronauts http://www.asc-csa.gc.ca/images/sts-100_kidstation_suit_mercury.jpg. Also, everytime I see these guys (other than Jeb), I keep thinking of this guy: BEAKER KERMAN! Perhaps he is working in mission control...
  21. Greetings and felicitations fellow Kerbalnauts! This is such a nifty little program and I can't wait to get some of these future additions. Wish the keyboard wasn't so sensitive sometimes though... Anyway, Jeb and I will see you in orbit! 8)
×
×
  • Create New...