Jump to content

cyberKerb

Members
  • Posts

    905
  • Joined

  • Last visited

Everything posted by cyberKerb

  1. Thanks for that - I think it make sense to me on my first intake of the information. The locationposition value of kerbin and the cone look fine after the un-parenting. I think It's the .position value that not correct and probably the bit that KSP needs to know relative movement when the camera moves things in the scene. Kerbins position is something in the hundreds of thousands. In trying to get the cone somewhere near those coordinates, I tried this using the LocalToScaledSpace function but it didn't do what I thought it would. I figured it'd take the number in the few hundreds and translate that to the give it the relative coordinates in the hundreds of thousands. As I just typed that sentence, I realized that's probably a stupid thought as the precision of the resulting number wouldn't be anywhere near where I'd want it. myConObj.transform.position = ScaledSpace.LocalToScaledSpace(myConObj.transform.position); Best idea I can come up with is to store my original position in a "shadow/scaled gameobj' before parenting it, and make the same relative offsets to both the shadow and the Kerbin.parented cone. That way I figure I could flip back and forth between being a child of Kerbin using the shadow cone and a reference point and the game wouldn't lose where I was supposed to be in the game space.
  2. Gah! - more learning for me. I tired to un-parent to cone in it's offset location using myConObj.transform.parent = null; While it did do as expected, (nothing moved) however, the now parent-less cone is desynced with the camera to the point where zooming in and out doesn't effect the size of the cone. It seems to have fallen into it's own worldspace not related to the current scene.
  3. Yep - misaligned axis was my issue. Cone object 'right' was not the same and the Kerbin object 'right'. Got around that with just using parents right. Happy to learn if there was an better way to do this. (I was able to set the axis the same with cone.transform.right = trackedcbmp.transform.right, but the below code skipped that step to reduce the code lines by 1. trackedcbmp = Planetarium.fetch.Home.MapObject; myConObj.transform.SetParent(trackedcbmp.trf); myConObj.transform.position = trackedcbmp.trf.position; myConObj.transform.localPosition = Vector3.zero; //Rotate down to the equator using Kerbin RightAxis myConObj.transform.Rotate(myConObj.transform.parent.transform.right, 90f); // Now move the cone Forward away from Kerbin myConObj.transform.localPosition = new Vector3(0f, 0f, 1000f); Thanks all for your fantastic help on this. I've still a lot to learn, but thanks so much for your patience. I hope I can bring my idea for a mod to light.
  4. Oh I'm such a...... idiot. I'd love you use more words there, but... public forum and all. The the process of testing, I seem to have managed to remove this little line here. cone_renderer.enabled = true; All works now. Thanks for the suggestion @Li0n works like a charm and I'm onto the relative movement. When I move the local positon to tilt it to the equator that worked no probs. myConObj.transform.Rotate(myConObj.transform.right, 90f); However, when setting the offset in the same direction as the cone was oriented, it didn't go where I expected - so I think my axis's are misaligned. The last float I thought was 'z' and should of pushed the cone in/out of the planet relative to the center. myConObj.transform.localPosition = myConObj.transform.localPosition + new Vector3(0.0f, 0.0f, 1000.0f);
  5. Personally I use everything except for the "Kemini" section of this mod. But I've always been a manual mod installer, so I wouldn't mind at all if it was only available in an al in one. I'd simply remove the Kemini sub-folder of experiments I didn't want to use.
  6. yeah it was. I wanted to see if it was possible to change how far from the poles the aurora appears. Sounds like with it being a texture it's not possible to change it's coverage range.
  7. Hi @Waz are the auroras a fixed element? I was wondering if there is an extendibility in the mod to allow other mods to modify some settings from EVE while the game is running (not via the Tracking centre menus). Specifically, are the auroras stuck at the poles or can they be "stretched" down to lower latitudes? (eg during a solar storm)
  8. Ok - As far as I can tell, I think I need to use slerp somehow to get the cone to around in an orbit. This is mainly because I can't work out how parenting works for an object that isn't selected/focused . Also I'm sure I'm messing up the local / scaledspace details. As far as I know, I'm moving the cone around in ScaledSpace as that's where the planet Kerbin seems to be. Both the cone and Kerbin are positioned in the same location and I have the cone big enough that it pokes through the surface to see it. With no parent, I can offset the cone so it's fully outside the planet with an additional vector to it's current position: myConObj.transform.localPosition = myConObj.transform.localPosition + new Vector3(0.0f, 0.0f, 90.0f); Back on the parenting attempt. Here's all I have in the latethannever process trackedcb = Planetarium.fetch.Home; cone_multiplier = 2500f; //so I can find the cone when it's not where it should be Vector3 scale = transform.localScale; scale.Set(cone_multiplier, cone_multiplier, cone_multiplier); myConObj.transform.localScale = scale; myConObj.transform.SetParent(trackedcb.transform); myConObj.transform.position = trackedcb.transform.position; myConObj.transform.localPosition = Vector3.zero; Once that is done and the scene it loaded, I check the debug info I've set up to output anytime I select an object: (top bit that got cut off is supposed to say "Scaled Kerbin") Cone is nowhere to be seen.
  9. huh - it's a CelestialBody. and I didn't relise it hap to be that. Def: CelestialBody trackedcb; onMapEnterEvent: trackedcb = Planetarium.fetch.Home; update: myConObj.transform.SetParent(trackedcb.transform);myConObj.transform.localPosition = trackedcb.transform.localPosition; Question: Is mapobject just the selected item or is there a way to select Kerbin as a mapobject even though it's not selected? Reason as that the cone I want it to be displayed even if the body is not selected.
  10. Already had layer 10. I was thinking to use rotate around, but Visual Studio is telling that Transform.RotateAround" is deprecated and to use transform.rotate instead. I tried the following to set the parent and thankfully the cone renders, but it's waaaaaay off in the distance and slipping away quickly. myConObj.transform.SetParent(trackedcb.transform); myConObj.transform.localPosition = trackedcb.transform.localPosition;
  11. Clicking a science experiment button in the right click/PAW menu is when my freeze/crashes happen. I've mostly had it on completing ScanSat analysis, but I've also had it on other experiments like stock GooCanister & temperature probe. So it's just when the science experiment result window tried to open. With 1.3.1 out, I've reinstalled everything again and need to have a good gaming session length to see if the problem comes up again.
  12. Hah, I'm still proving I'm a dunce. On the drive into work musing about KSP things (as you do), I realised why "rotating around the planet with an altitude" sounded weird... Yeah, it's a long way of saying 'orbit'. Don't mind me, I'm now searching on issues with parenting an object. My cone disappears when I used the parent method @sarbian suggested earlier in the thread. I'm thinking I might need to check to scale gets set to zero or something which could make the cone be hidden inside kerbin. My debug info says it have no position though, so as far as I can tell, it's not rendered the scene that I can see.
  13. here's probably a math query (I think). So I've got my cone pointing where I want to, how would I move the transform so the point of the cone is closer to the surface of Kerbin? I tried a straight change to x and or z and that just changes the central rotation point of the cone away from Kerbin. I'm looking to basically change the cones altitude relative to Kerbin. Currently the cone assigning code looks like this. I wasn't able to get the parent method to work for me. CelestialBody trackedcb = Planetarium.fetch.Home; myConObj.transform.position = ScaledSpace.LocalToScaledSpace(trackedcb.transform.position); //Set Scale Vector3 scale = transform.localScale; scale.Set(cone_multiplier, cone_multiplier, cone_multiplier); myConObj.transform.localScale = scale; //Set Rotation relations to CB Body q2 = trackedcb.transform.localRotation; myConObj.transform.localRotation = q1 * q2; //Rotate down to Equator myConObj.transform.Rotate(Vector3.right, 90f); cone_renderer.enabled = true;
  14. Gah! This modding rabbit hole is deeeeep! There is no way in a million years I'd find that out through the stumbling trial & error process I'm using to attempt to cobble this idea together. Thanks so much @sarbian - works fantastic and the movement is now in sync with the camera. I'm able to lock the cone to the planet and there in no delay at all now. I even got the cone to rotate with the planet using @Rodhern code with a minor modification as I think we are talking in different langs (I'm using c#) and I couldn't find a op_Multiply function. Start process GameEvents.OnMapEntered.Add(MapEnter); MapEnter process q1 = myConObj.transform.localRotation; CodeWeWantToRunLate process q2 = kerbin.transform.localRotation; myConObj.transform.localRotation = q1 * q2; here's the dll is you want to see how I've done so far.
  15. Awesome - thanks for the help. I'm going to head to bed and get some sleep, but I'll bang against the keyboard again tomorrow.
  16. Thanks for this suggestion! The line "marker.transform.Rotate (Vector3.right, 90f);" is what I was missing with being able to turn the cone on it's side but still rotate with the planet. Still have to work out the shaking bit now.
  17. OK - I've got the cone up again, but it's acting weird when I I use timewarp or move the camera.. Initially it's got a really loose connection with the world in that it lags behind where it should be if I move the mouse quickly. When I time warp, it shakes around like mad to the point where there is 3-4 after image cones dancing about. You can see in my logging that the localPosition is all skewif [LOG 00:37:43.459] [PlanetariumCamera]: Focus: Kerbin [LOG 00:37:43.467] [TestCone] CelestialBody: Kerbin [LOG 00:37:43.482] [TestCone] SelectedMAPobj: Kerbin [LOG 00:37:43.483] [TestCone] position: (2680.5, -231.0, 830.6) [LOG 00:37:43.484] [TestCone] localPosition: (2680.5, -231.0, 830.6) [LOG 00:37:43.485] [TestCone] localScale: (0.1, 0.1, 0.1) [LOG 00:37:43.486] [TestCone] [LOG 00:37:43.487] [TestCone] CONE: [LOG 00:37:43.488] [TestCone] position: (2681.0, -231.0, 832.0) [LOG 00:37:43.489] [TestCone] localPosition: (-8693757.0, -1245.9, -15056520.0) [LOG 00:37:43.490] [TestCone] localScale: (808.1, -231.1, 3042.3) [LOG 00:37:43.491] [TestCone] x:2681 [LOG 00:37:43.492] [TestCone] y:-230.9753 [LOG 00:37:43.493] [TestCone] z:832 [LOG 00:37:43.494] [TestCone] [LOG 00:37:43.495] [TestCone] DirectRefKerbin: [LOG 00:37:43.496] [TestCone] position: [2680.55646281518, -230.975326534619, 830.54064281733] [LOG 00:37:43.497] [TestCone] localPosition: [2680.55646281518, -230.975326534619, 830.54064281733] [LOG 00:37:43.499] [TestCone] localScale: [808.114816202753, -231.144311528333, 3042.25711912938] Here's the dll if someone wants to see the effect realtime (compiled under 1.3.1) Throw it under a folder in the Gamedata folder, load a game and go into tracking center to see what I mean.
  18. I can't find a "Planetarium.Sun.MapObject.trf.position", is it this one? "Planetarium.fetch.Sun.MapObject.trf.position" Or do I need another reference somewhere?
  19. For the "positionOfTheObjectYouWantToPointTo" - if I just want to point the cone away from the celestial body, is it as simple as saying Vector3.right or does it need to be an actual ojbect? That's the problem with pointing away the reference CB, I don't want to look at it's direction.
  20. The cone code I'm using is just the unity example to draw a procedural mesh. There's a few examples of various shape on this page. http://wiki.unity3d.com/index.php/ProceduralPrimitives
  21. Because I copied an example from 4 years ago for game with little documentation and bugger all knowledge on what I'm doing? Thanks for the info, that indeed did fix that issue. I now need to work out how to get the cone to rotate with the body. As I understand it using the below setting rotates the cone from pointing straight up to 90 down to the equator. myConObj.transform.eulerAngles = new Vector3(90.0f, 0.0f, 0.0f); I'm pretty sure I can't use: myConObj.transform.localRotation = Quaternion.identity; as that locks the rotate to "don't rotate". I think I'm after a Quaternion.LookRotation and need to look up more on how that works. Or putting another way - I need to point red (right) and rotate green (up).
  22. I've fixed most of the references to give the correct numbers for where Kerbin is in the scene. I just need to work out how to convert: FlightGlobals.Bodies[1].transform into the Scaled scale numbers so I can assign it to my object.transform.parent. myConeObj.transform.position = ScaledSpace.LocalToScaledSpace(FlightGlobals.Bodies[1].transform.position); myConeObj.transform.parent = FlightGlobals.Bodies[1].transform; myConeObj.transform.localScale = ScaledSpace.LocalToScaledSpace(FlightGlobals.Bodies[1].transform.localScale); myConeObj.transform.localPosition = ScaledSpace.LocalToScaledSpace(FlightGlobals.Bodies[1].transform.localPosition); myConeObj.transform.eulerAngles = new Vector3(90.0f, 0.0f, 0.0f); the last line doesn't work quite how I want it to. It give me the myConeObj out of the equator (as I want) but it's in a fixed location and wont rotate with the body.
  23. I want to add an object / linedraw that starts from the center of Kerbin in the map view. It needs to be visible regardless of which CB/Vessel/Node is the active/selected/focused item. Using the code in this thread, I was able to get a sphere in the map scene as a way for me to learn about putting objects in the map screen, but I can't work out how to reference Kerbin as an entity directly so I can always use it as the reference object. The example only ultilsed the selected CB or vessel in the tracking center. I don't want to use the active object as this object/vector needs to be visible regardless of the selected vessel / CB I've tried to reference the CB as seen below; CelestialBody kerbin = FlightGlobals.Bodies[1]; The issue is assigning the appropriate transform to have the vector coming out from the planet myLineObj.transform.position = ScaledSpace.LocalToScaledSpace(kerbin.transform.position); myLineObj.transform.parent = kerbin.transform; myLineObj.transform.localScale = Vector3.one * scale_multiplier; myLineObj.transform.localPosition = Vector3.zero; myLineObj.transform.localRotation = Quaternion.identity; Is there a primer on working with transforms / Vector3 / Quaternion stuff, as I'm struggling to get my head around it all. Thanks in advance
  24. okies - I actually modified a copy of the play button into a magnifying glass and gave it the correct name to get rid of the error. On the off change I use the search button, I'll PM you
  25. All OK - checked the changes and updated my copy easily enough. I've seen way worse with error, so don't beat yourself up over it. I'm also seeing an issue where it's coming up with an error in the log about a missing icon search file: [ERR 09:20:44.034] [OSE] - Filter - Unable to load texture file Workshop/Assets/Icons/icon_search The error is under both this mods parts as well and MKS and KPBS part that use workshop in their mod support. I checked githib and that file isn't there - guessing it got missing with the icon update?
×
×
  • Create New...