Jump to content

Parastie

Members
  • Posts

    14
  • Joined

  • Last visited

Reputation

0 Neutral

Profile Information

  • About me
    Bottle Rocketeer
  1. After much messing around, I finally got my docking script to work...well most of the time anyway. The code is an absolute mess and my vectors overshoot, as you can see in the video. Basically, I should calculate the needed thrust better (instead of just running a pulse until the desired speed is met). I have ideas of how to make this work better, but I'm going to have to take a break for the next 3 months while RL gets in the way. Thank you Steven for helping me! Here's a pastbin to the code, I added lots of comments to help myself and anyone else who'd look at what's going on. See you guys mid May! Can't wait to see how this has progressed by then!
  2. Hey that helps a lot! I'm actually not using "control from here" as there's a bug that if you change control from to something other then what's inline with the ship and try to lock steering, it just spins out of control. I had thought that multiplying my target vector by a rotation would get me the correct information, but that obviously wasn't correct. A few more refinements and I should get it. I had assumed that facing, and portfacing were the same, but having checked, you are correct they are not the same. The vectors differ slightly in the above configuration (though not in the screenshot). I'll have to give that a shot when I get more time. I'm still not sure why exactly the orange vector is pointing ever so slightly off, even though the angles I'm getting are more correct. It's lightly from the portfacing vs facing.
  3. Question on vectors (again). I have 2 spacecraft with ports somewhere in their middle section. Lets say that I have the port from the ship I'm controlling perfectly inline with the port on the other shift. I should be able to type, lock myporttotargetport to (myport:facing*target:position). And that should give me a vector from my port to the targetted port, right? So, I should be able to lock myporttotargetangleZangle to vang(myport:facing:vector,myporttotargetport). lock myporttotargetangleXangle to vang(myport:facing:starvector, myporttotargetport). lock myporttotargetangleYangle to vang(myport:facing:upvector, myporttotargetport). To get the angles between the vector facing the target port, and 3 coordinate vectors and they all should be originating from my port. The problem is, (and I know that Z,X, and Y lables are not likely to be correct) that if the ports are point directly at each other, then the myporttotargetangleYangle should be 90 degrees, and it's not for some reason. Does any of that make sense? Basically I'm trying to use the angles to determine if the ship is lined up correctly, but I can't get the angles to line up to what I think they should be. EDIT: Here's a screen shot of what's going on the screen, and I've dumped my code into a pastbin. I'm just not sure exactly how to get the angles I'm expecting. The orange line should draw from my port to the target port, however it appears just slightly off for some reason, and this is also reflected in the angles I'm getting. Any help would be great! Thanks guys! (I should note that I'm using code that Steve Madding posted awhile back, which works great!!) http://pastebin.com/T8LJjKrh
  4. That works perfectly! The ship points exactly where I want it to, and now I understand better what's going on. I'm going to have to think about this a lot more, but I've got a good idea how I want the movement to to work now. Thanks again!
  5. In your video, are the offsets for the different docking ports hardcoded, or is your script able to calculate the offset and make adjustments on its own? I'm assuming your script calculates it, as each port is it a wildly different point.
  6. I must come off as as an idiot sometimes... I've only one question about your script. Are you using raw controls for rotation, or is it possible to figure out the correct vectors to use cooked controls? As in, you're able to lock steering and/or lookdirup to rotate the ship to place the port in the correct orientation?
  7. I like the idea of this, especially since it's more or less what I've been trying to do (my difficulty is time, with my family at home and work, I have little time to play games). I think it'd be worth making a standard "station" craft file that anyone participates can download, perhaps even a save file with the station already in orbit. It would help standardize the challenge. If someone takes this up, please PM me the link to your challenge, and I'll place it as a sticky on the subreddit for kos as well! Also, thanks very much for the tutorial! At least I know it's possible to do what I've been trying to do. I'll see if I can get it before you make your longer tutorial. Thanks again!
  8. Hey I've got another question. If i do print ship:position I will get v(0,0,0) and that's a vector right? And when I print part:position, is that number relative to the ship, or is it relative to the universe, or am I just not understanding how the vector systems works? Basically, I'm trying to get the side port to line up with a target. The side port's position shouldn't change relative to ship's position as it's fixed to the ship. I should be able to just be add the port's position to the ship's position, and then minus that from the target's position to get where they are relative to each other right? My problem is, the port on the ship's position when i type, print port:position (and i'm certain it is the port on the ship) keeps changing, and i'm not certain how exactly i should fix it in order to zero out movement relative to target and get alignment for a docking. I understand that we're suppose to figure this stuff out on our own, but any any help (including pointing me to some reading material so i can understand this better) would be a great!
  9. LoL That would be very helpful. I'm having a hell of a time trying to get the side port to position itself correctly. I suppose I could just get the position of the port, then use raw control to position of the control ship's port until the positions zero out. I think that would work...
  10. Sure, it does it every time. That's why I'm now trying to figure the angles to the port so I can get it to align with a target. I thought it should be 90 degree angle but I see I'm going to need to read a lot more. I'll try to put a bug report up today.
  11. Thank you that works great. Now I'm just figuring out the movement and steering. Here's a fun thing I discovered: if you have a inline docking port and set 'control from here' on that port, then attempt lock steering to up. It will spin around like mad, at least the small probe I have in the pictures above does. I think its because the torque and the center of mass are not lines up with port. It will lock with no problem as long as I leave the control on the probe computer.
  12. The problem then must be my syntax for the origin point of the vector. Sorry if this is a very easy answer, but I haven't played with programming since Basic and Pascal in high school and geometry/trig was around that time as well. Here's the code: lock t1 to ship:position. lock pv to port:portfacing:vector. set pm1 to ship:modulesnamed("ModuleDockingNode"). for portmod in pm1 {set port to portmod:part.}. set aa to vecdrawargs ( t1,pv,RGB(0,1,0.5), "axis", 5, true ).
  13. Question regarding vecdraw and an offset piece. Basically, I have an inline docking port and I'm trying to get the origin of the vector to be the docking port. However, when I set the vector origin to the port origin it generates off the main ship. I'm guessing the the position is a raw position and I can't figure out the proper syntax to get the ships raw position (as apposed to (0,0,0). I'll post my short script when I get home from work if it'll help. Thank you!
×
×
  • Create New...