Jump to content

[1.0.4] AirPark


Smelly

Recommended Posts

AirPark v0.12

Freeze your vessel in atmospheric flight and resume it later.

Download from Kerbal Stuff

Instructions:

Install by copying to GameData folder. Doesn't require any other mods.

Place the AirPark part (located under the command and control tab) anywhere on the vessel. While in atmospheric flight toggle AirPark from the part's right-click menu to freeze the attached vessel in place and mark the vessel as landed. From here you can switch aircraft or return to the space center and your vessel will remain in place. Returning to this vessel and toggling AirPark off will resume the flight at the velocity it was frozen at.

The AutoPark toggle, when enabled, will deactivate AirPark for the attached vessel if it is not the active vessel and is within 1.5 km of the active vessel. It will reengage AirPark if it's distance exceeds 2 km of the active vessel. Use this feature to allow midair refueling without having to launch both vessels at the same time. Simply AirPark one of the vessels ahead of the other with AutoPark enabled and fly the other vessel to the parked one. You can also use this to freeze separated launch stages and land them later or attempt other shenanigans.

Notes:

New mod (and new modder), there will almost definitely be bugs I never found or improvements I never thought of while playing with my limited time. Post any issues or suggestions you have.

License: GPLv2

Source: GitHub

Link to comment
Share on other sites

Since this marks the vessel as landed, would it allow manipulation using BahamutoD's VesselMover?

http://forum.kerbalspaceprogram.com/threads/137438-1-0-4-VesselMover-v1-1

I'm not in a position to test it for a few days, if someone could give it a shot and post results it'd be appreciated.

No major issues on that front. Worst issue is that Airpark prevents VM from actually moving the craft. However rotating is fine and let me do some interesting experiments. Like what happens when a craft going 300m/s is frozen, rotated 90 degrees up, and resumed.

Link to comment
Share on other sites

I'm definitely going to try this out, it may help me complete a couple of mods I put on the back burner, Air Stations (like space stations and moon bases but they fly) AND Flying Aircraft Carrier (make it rocket, turbine, or balloon powered, it doesn't matter it flies!). Seriously cool stuff!

Link to comment
Share on other sites

That's a great solution for any kind of air dropped asset. Instead of having to hope the carrier craft holds steady and doesn't go too far as to despawn, you can safely handle your payload and just switch back to the carrier and return it. Awesome! Pegasus-style launches coming right up! :)

Link to comment
Share on other sites

I had a quick test with auto-parking recoverable boosters, and noted two things:

* It would be handy to set autoPark from the editor so it is saved with the craft file.

* When switching to a auto-parked piece of debris, auto-unpark does not trigger and the vessel stays frozen in the air. Since the vessel has no control part, I can not un-park it manually. Why this exception for the active vessel? For me the most logical behavior would be to always do both actions (park and unpark) manually or both automatically.

Link to comment
Share on other sites

I had a quick test with auto-parking recoverable boosters, and noted two things:

* It would be handy to set autoPark from the editor so it is saved with the craft file.

* When switching to a auto-parked piece of debris, auto-unpark does not trigger and the vessel stays frozen in the air. Since the vessel has no control part, I can not un-park it manually. Why this exception for the active vessel? For me the most logical behavior would be to always do both actions (park and unpark) manually or both automatically.

When I was developing this mod it was with the intention of enabling midair refueling (not so much booster and part recovery) so I had expected that both vehicles would have controlling parts. The reason for autoparking was to make sure that if you flew near an airparked vessel it would resume flight (as you can't switch a flying vessel to a nonflying vessel with the [] keys to manually toggle airpark off) and pause when leaving it. It wasn't added to make returning to a vessel automatically unpark it or park when hitting pause. I also had expected that anyone using it for booster recovery would be doing so with the intention of flying it back to a runway or attempting powered landings and therefore have a controlling part on it as well and could manually disengage the airpark that was caused by autopark whenever they wanted to.

Having said that, you do point out a big flaw when using the part with uncontrollable things. I'm currently looking into having autopark behave differently when the vessel is uncontrollable (unpark when loaded and park when pausing), but still working on getting it to function. In the mean time, you still can recover the parts that are left airparked (as they are considered landed), so if you intended to use it for parachute recovered parts (and don't care about complete accuracy) you can just strap a parachute on it and assume it would have worked. I'll also look into adding autopark to the editor and getting action groups set up for it, as that does seem very useful. Thanks for the feedback!

Edited by Smelly
Forgot to quote...
Link to comment
Share on other sites

No major issues on that front. Worst issue is that Airpark prevents VM from actually moving the craft. However rotating is fine and let me do some interesting experiments. Like what happens when a craft going 300m/s is frozen, rotated 90 degrees up, and resumed.

AirPark resets the position of the vessel to where it was frozen during physics updates as no matter what velocities and accelerations I reduce to zero I can't get it to remain completely stationary without doing that (there is a very consistent 0.2 m/s downward velocity without it, if anyone recognizes why that is let me know). I never did lock the rotation any more than setting angular speed to zero (vessels didn't rotate for no reason unlike the velocity), so you can rotate (both with VM and with the standard controls) it and it will keep where you left it. Unless I can figure out to get rid of that 0.2 m/s drop without adjusting position there isn't any good way to reconcile positional location with VM while they are both active. You can however airpark a vessel, turn on VM, turn off airpark, and then move it with VM, then renable airpark and turn off VM. Not sure of a reason to do this though as VM will lower the height to just above the ground and Airpark won't return it to the original height.

I also may end up locking the rotational setting if that ends up being a problem with floating bases slowly rotating from applied forces since that seems to be a lot of people's goal, but I'll leave it unlocked until then as it might be more beneficial to let you rotate it.

Link to comment
Share on other sites

So one could zip in over the runway, engage this to put on the air brakes then have it settle down at 0.2 meters per second? Sounds like a sometimes useful 'glitch'. What happens when the airpark is turned off after the craft actually lands?

Link to comment
Share on other sites

So one could zip in over the runway, engage this to put on the air brakes then have it settle down at 0.2 meters per second? Sounds like a sometimes useful 'glitch'. What happens when the airpark is turned off after the craft actually lands?

Probably something similar to this:

Javascript is disabled. View full album

Granted this was a straight dive, but the G-forces get kind of ridiculous.

Edited by FungusForge
Link to comment
Share on other sites

Nice. This is something I've poked at as an academic curiosity, as a way to root airships from the hooligan labs mod. Your method is much simpler/better than what I was looking at.

My thought was to create a physics-less object (no collision, no visible model) at the same place as apart with the parking module and create a strong joint between them. The invisible anchor doesn't move relative to the parent body and the vessel is held into place by normal joint forces. It's an old gaming physics trick and I have confirmed this is the same method KIS/KAS uses to create ground anchors.

Though I was under the impression the game would reset a vessel's position back to ground level when loaded, to compensate for position rounding in the save file.

Link to comment
Share on other sites

I have been testing the AirPark mod and I have one single issue to raise:

-After AirPark has been used, the craft becomes a 'Landed Vessel' with no map-view trajectory or quicksave ability (moving over terrain warning message). It does not return to being a spaceship or probe after ending the Airpark effect.

What can be done about this?

Link to comment
Share on other sites

I have been testing the AirPark mod and I have one single issue to raise:

-After AirPark has been used, the craft becomes a 'Landed Vessel' with no map-view trajectory or quicksave ability (moving over terrain warning message). It does not return to being a spaceship or probe after ending the Airpark effect.

What can be done about this?

I have no way of doing the map-view trajectory the way I have the mod set up short of rewriting the entire trajectory drawing system. The quicksave issue I never ran into in initial testing, but I went back and tested it some more after reading your post and only managed to get that moving over terrain warning when the vessel had engines on and was at about a 90 degree pitch. I don't fully understand why that happens. My only guess is that it has something to do with some oscillations or rotational speed in the vessel being above a certain threshold. I'm also guessing that the issue is pretty vessel and rotation specific. My 350+ part 500 ton exercise-in-computer-melting / Stock SSTO had no issues in level flight, and the VTOL I was doing testing with I managed to quicksave by altering it just a few degrees from that 90 degree pitch or simply turning off the engines. Freezing the physics position of every part to try and get rid of that rare bug doesn't seem worth it performance wise, so I suggest making sure engines are off and try to stop it from rotating (if it is) to get past that bug. Not a comprehensive solution I know...

As for the post effect issues, I'm not exactly sure what you are referring to. I've had no issues with post effect changing anything. The ships resume exactly as they were in flying state (trajectories appear again, etc...). If you are trying them in space it shouldn't do anything since it's function is disabled in space (the effect that makes it landed in the atmosphere would crash the game in space). I need some clarification as to what the problem is there.

Also, thanks for the code suggestion above. Unfortunately I'm such a noob at KSP modding I don't even know where that goes...

Link to comment
Share on other sites

I have no way of doing the map-view trajectory the way I have the mod set up short of rewriting the entire trajectory drawing system. The quicksave issue I never ran into in initial testing, but I went back and tested it some more after reading your post and only managed to get that moving over terrain warning when the vessel had engines on and was at about a 90 degree pitch. I don't fully understand why that happens. My only guess is that it has something to do with some oscillations or rotational speed in the vessel being above a certain threshold. I'm also guessing that the issue is pretty vessel and rotation specific. My 350+ part 500 ton exercise-in-computer-melting / Stock SSTO had no issues in level flight, and the VTOL I was doing testing with I managed to quicksave by altering it just a few degrees from that 90 degree pitch or simply turning off the engines. Freezing the physics position of every part to try and get rid of that rare bug doesn't seem worth it performance wise, so I suggest making sure engines are off and try to stop it from rotating (if it is) to get past that bug. Not a comprehensive solution I know...

As for the post effect issues, I'm not exactly sure what you are referring to. I've had no issues with post effect changing anything. The ships resume exactly as they were in flying state (trajectories appear again, etc...). If you are trying them in space it shouldn't do anything since it's function is disabled in space (the effect that makes it landed in the atmosphere would crash the game in space). I need some clarification as to what the problem is there.

Also, thanks for the code suggestion above. Unfortunately I'm such a noob at KSP modding I don't even know where that goes...

Well, I'll do some more testing and get back to you.

My code is supposed to be inserted into any .cfg file and placed in GameData.

-Advantages of my code: Every command pod gets the AirPark module without needing an extra part.

-I'm guessing the disadvantage is that the AirPark module never 'switches off' so that the vehicle is now considered a Landed vehicle even after you disable AirPark and start moving again.

I'll try testing with your original part.

My only concern... is that your part appears in the tech tree.. but not in my parts list.

Maybe it's because Realistic Progression Zero messed up something...

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...