Jump to content

philotical

Members
  • Posts

    464
  • Joined

  • Last visited

Everything posted by philotical

  1. Bull ...., I started with c# in KSP last april.. Aqua might be right - but this is no answer for your question.. No, you don't need to define the vessel in this case.. you are working on a "PartModule" - they all come with some vars to work with. (inheritance) One is the vessel this script runs on => this.vessel While you controll this vessel, it's the same as "FlightGlobals.ActiveVessel" While you controll an other vessel, this.vessel still contains the same vessel reference - the one with the part module.. It's used for things like making sure your script only runs when you ARE controlling this vessel - example: if(this.vessel == FlightGlobals.ActiveVessel) { //The vessel with this script is the active vessel } That is why it's there - so you can figure out what's going on at runtime. Ok - it's not there only for that, but that is how you use it mostly.. The second one is this.part works the same but references the part the module is running on.. With those two infos, you have alleady passed the tick tack toe state in my opinion... The other terms Aqua mentined are usefull to know but not relelvant for your task here.. btw - I also am a coder since decades - but c# and Unity and KSP is new to me PS: may beMichael explained all that allready - tl/dr before breakfast - if so, I appologize.. ok - time for breakfast.. :-) En scheene liebi lüüt... that's swiss german for: you all have a nice day pals..
  2. your code asks for FlightGlobals.Vessels, afaik that is not available in Main Menu or at space center.. you should add this then your code only runs in flight scene..
  3. Nice of you to ask - yes it's playable! I have 3 finished missions (and dozens small test crap mission, not publishable) that are playable and some extended story lines I need to turn into CFGs.. The two mods offer currently: - 7 Stations (with Station LCARS) - 7 Ships (LCARS Mark II) - 6 Space Anomalies (Ion Storm etc..) - 3 Hostile Aliens (with NCI Follower AI - Soon with weappon AI) It's planned to build Mines, Armed Satelites, both stationary in orbit and lots of Alien Ships that actually can attack (NCI AI) - 7 LCARS Mark II ships in varying sizes The Weappons aren't done yet - but everything else is.. It's planned to teach the Hostile-Objects to shoot on you - now they only circle around you like vultures - but so far peacefull.. The Mission Editor V2 is almost done and then I'll write some more missions.. New NCI features worth mentioning: - Passenger transport - Player Rank - you start as CrewMan, progres to Ensign and end up as Fleet Admiral with respective Clearance Level from 0 to 10 - Missions have a clearance level - if your's is too low, you can't play the mission - Missions can be set to ignore so they won't start again. - The NCI GUI at space center was completely rewritten. You can now review missions, mission logs and details about all objects there. Station LCARS - the OS of all stations has following features: - Activate Deactivate the Sherman Docking Ports - Fueltank Management - all station come with a comfortable amount of Condensed Deuterium wich is needed for all LCARS Mark II ships. Use statoins to refuel - Fuel Transfer System - Crew Manifest - and Station Info Panel to see weight and stuff.. LCARS, Station LCARS and NCI are 100% compatible.. LCARS is the only one that can be used alone.. the others are dependent on LCARS.. I guess that covers it.. In general: It's bound to have some minor but hard to locate bugs and some tweaking is needed too.. I would appreciate some seriouse minded beta testers - only for GamePlay, Mission Creator isn't ready yet - but I can only use experianced people! If you are not able to debug a mod, I can't use you.. If you are, send me a PM.. that goes for all intrested readers.. PS: I'm working on some kind of documentation for mission writers.. here an excerpt that explans a lot about missions.
  4. sorry for the late answer, I actually missed it.. Well - what does unresponsive mean? I'll help you debug, if you describe the problem.. If you use the ship provided in the download (aurora), you might not get any trouble and no cfg changes needed.. if you didn't use that, please tell me at least what you got there.. Welcome to the forums btw :-)
  5. if(!GameEvents.onVesselGoOffRails.Contains(VesselUnPack)) { GameEvents.onVesselGoOffRails.Add(VesselUnPack); } no?
  6. This is all I know about it: http://docs.unity3d.com/412/Documentation/ScriptReference/Texture2D.Texture2D.html it looks as if you have a custom function named newTexture2D(320,180) (or was that space ommitted newTexture vs. new Texture?) my guess is, in that function newTexture, those numbers are ignored and the size of the texture is wrong..
  7. That is not what I ment: AFTER you load the image from the net, the c# code that creates your RAM texture does a rescale without you knowing it!! That is what I mean.. What probably happens is this: - pic has 200x200 on hard drive - pic get's loaded by your script - pic has 25x25 in RAM - pic has 200x200 in GUI - result blurry display.. your code has one faulty line, that does an unwanted rescale.. look for that or you'll search forever :-)
  8. [Edit: ninjad - partially outdate] You said shared vessel, so I thought you load vessel pics from a web server.. but as sarbian said, no need to use www if the pics are in game data.. However: your images are downscaled and re-upscaled somewhere - it's obviouse from the screenshots.. I might be wrong with "where" it happens - but these pictures have a scale issue - without seeing more code, it's hard to confirm - but my gutt says so lol The fact, that even the MJ pic gets screwed up prooves that my belly is right this time. that pic gets scaled down to at least it's half and displayed larger then the RAM texture is. you can try it in any graphic progam, load the pic, scale it down, rescale it up - you will get that result.. good luck on debugging this - but keep looking for a scale issue..
  9. first thought, your images are created too small and get upscaled.. can that be the problem? my stock toolbar buttons are 36x36px btw.. I thought it's the default.. new Texture2D(24, 24); will downscale all images to 24x24 It's likely this is the cause.. If that's the problem, you may want to get the image original width/height first and create your Texture2D with these dimensions.. was just a guess, if I'm wrong, never mind..
  10. it might be a good idea to store the "relative location" of the trailer vessel, if you do that, you can easely re-position it, even on the first physics frame and add the joint then.. at least that is what I think could work simpler and it would handle the drifting away problem just the same.. In my opinion, what you try to fight here is a race-car-condition.. It might not allways come up in the same order.. - so the first physics frame is still invisible to the user and surely not too early I've been workin on a "soft docking" for my huge stations - ship stays there but is still seperate - I use forces for this and the results are not as good as hoped.. So I'm very intrested in your code if this get's released :-P It might solve my problem too.. The seperate vessel thing is required for an NCI detail in case you wondered.. if they'd docked real, NCI would no longer work as it should..
  11. lo-fi, found a bug and fixed it.. I'm not sure I did this right on github, but you can see the change here https://github.com/philotical/TextureAnimator/tree/philotical-patch-1 It's a minor change in onStart that prevents an NRE if the cfg is faulty.
  12. yw recursively: yup http://docs.unity3d.com/ScriptReference/Component.GetComponentInParent.html
  13. something like Part p = go.GetComponentInParent<Part>() as Part; should do the trick..
  14. welcome to the forum.. Have a look in this thread.. http://forum.kerbalspaceprogram.com/threads/94638-Mod-Development-Links-Compilation-START-HERE
  15. I would parent the GO to something that moves - if it works, call it "done".. Valid is what wroks.. and old coder rule...
  16. I juts saw, you are swiss - so am I lol.. (Vo wo bisch denn? Mich findsch z'Laufe BL..) >As I understand it component do not have their own transform. This is wrong and right.. components do not have an own but they are added to a game object - and this game object has a transform.. >Can somebody explain this? For the time I'll add the audio to the part. I can't.. sorry.. I don't know if that is "normal" but I doubt it.. never seen this - so it might be something wrong in your set up..
  17. maybe your sound stays at the launchpad.. in terms of: the parent value of the audio-gameobject is not set correctly.. so if the ship moves, the audio stays at the global location it is created.. alarmAs.transform.parent = ??? or light.transform.parent = ??? hth
  18. havent looked into it in detail.. look at FollowMe.. - it'll help
  19. Kerbals are vessels.. So all you need is in FlightGlobals.ActiveVessel.transform.. or in the list FlightGlobals.Vessels you find the not active ones.. Have you looked at "FollowMe" - it moves kerbals around..
  20. the problem is, you need to find out the orientation/rotation of the hull peace you want to attach to.. the only way I heard of is to use raycast. This will give you a "HitPoint" - this hit point should have a rotation according to the hull peace you hit. But still, programmatically => without mousclick, to get such a hit point at the right position might still be hard.. Kas does what you need - but it does it after a mouse click to find the location.. How exactly they do it, is nothing I could help with.. HTH
  21. for VS follow this http://msdn.microsoft.com/en-us/library/7314433t%28v=vs.90%29.aspx I assume your IDE has some documentation - right? follow that to add the references: UnityEngine.dll and Assembly-CSharp.dll you will find them inside the KSP-Data folder.. it helps if you have an IDE with intellisense.. so you know an error before building btw.. if VS is available for mac, it could be a good idea to change... HTH
  22. That looks nice.. It seems, it could be said, that you know your way around the props configs.. If you would agree with that assesment, would you be intrested in contributing to an experiment? I need a props expert for a test... PM me if you are intrested.. thanks.. keep up the good work..
×
×
  • Create New...