Jump to content

Flight path recorder. Record a flight and then chase it around! V1.2


Snjo

Recommended Posts

This mod has been merged into Persistent Trails

Head to that thread instead

This is the first public usable draft of the new flight recorder.

You can record a path and then play it back later. A dummy plane will fly around following the path you flew originally.

Download

v1.2

-Save and load paths to files.

-Alternate models can be defined for the paths by editing the path file for now.

Take care when loading a path to not occupy its starting position with your current vessel. Cause you will blow up.

The recording and manual play back is now the "work path". When a work path plane ends its run, it will fall out of the sky rather than be deleted, even if Go off rails at end" is marked.

Paths loaded from external files will play automatically, and the plane will either loop, be removed or fall out of the sky (go off rails) when the path ends.

Menu explanation

Pl6qEsT.png

Record - Starts or continues recording to the work path.

Stop - Ends the recording. Also calculates the time to return the start for looping paths.

Clear - Clears then nodes, and adds the first node at the current location. Best used while recording is active.

Add node - For precise work like recording a stand still, or small ground movements, add nodes at the start and end of the stop to make it look better.

Loop path - If ON, the plane will return to the start of the path when it reaches the end, using the end speed.

Off rails at end - If the path isn't a loop, the plane will fall to the ground after the path ends. Otherwise it will be deleted. (Unless it's a work path playback)

Play - Plays the work path

OffRails - Makes the work path plane fall down

Save - saves the work path using the file name in the text box

Load - Opens up the path loading dialog

Alt+F6 - show/hide the menu

Current limitations:

-It will not use your craft as the dummy, but the model in the models folder, but it can be replaced. (You could make a new plane model, or a truck, whatever)

-No sound on the dummy plane.

How it works:

When recording, nodes will be created storing the vessels current position, rotation and velocity. Nodes will only be created if there has been sufficient change to those values, so you will create lots of nodes during turns and other maneuvers, and very few when flying in a straight path.

To precisely record a small taxiing maneuver or a stop,you can add a node manually.

By default, no nodes will be created if you have moved less than 2 m. The precision settings will be controllable later on.

Source code

License: You can re-use the code as you want, as long as you give attribution in the forum post and readme file. You can rename and recompile stuff, but not repack the plugin as is in your own mod without permission.

Any models, sounds, textures or other assets are not for re-use without permission.

Edited by Snjo
Link to comment
Share on other sites

Hey Snjo, thats what i never got working with my Persistent Trails plugin. My plugin has all the persistence and multiple recordings management, but for playback i only use a simple sphere, and i have no fancy keyboard shortcuts. I would be interested to merge our codes into a single even better plugin. If i store a craft file reference for the path, would you be able to select the appropriate model from the model folder?

Also, you need to declare a licence for your plugin.

Link to comment
Share on other sites

Hey Snjo, thats what i never got working with my Persistent Trails plugin. My plugin has all the persistence and multiple recordings management, but for playback i only use a simple sphere, and i have no fancy keyboard shortcuts. I would be interested to merge our codes into a single even better plugin. If i store a craft file reference for the path, would you be able to select the appropriate model from the model folder?

Also, you need to declare a licence for your plugin.

You know, that's not a bad idea, the combined result could be very cool!

Compiling a dummy out of a craft file is a big task though, so I'm saving that for last :)

edit: the down-the-road plan is stored paths used in things like attack, defend and escort missions. Imagine defending a bomber while fighting off enemy fighter planes.

Edited by Snjo
Link to comment
Share on other sites

Yes! Automatically moving patrol cars / planes / spaceships would be really cool. Lets do the rest via PM

Compiling a dummy out of a craft file is a big task though, so I'm saving that for last

I thought thats whats already happening, but now i see that you are storing mu files for that. Hmm, is it possible to write these models at runtime (i.e. "create a model for the currently active vessel")? Or maybe store the 3d model of the vessel in another format for later playback?

Link to comment
Share on other sites

As this mod adds good functionality for making videos, and the two pieces of video recording software I've ever used (one of them, Fraps, seems to be the de-facto software to record) use F12 as a default, you may want to change your "F12 for menu" option. Or, make a way to change it to something else.

Link to comment
Share on other sites

I have to ask: Whats with the kinosaur bones?...lol

They are whale bones. They're a static I made for Kerbtown. I like to barn storm them.

As this mod adds good functionality for making videos, and the two pieces of video recording software I've ever used (one of them, Fraps, seems to be the de-facto software to record) use F12 as a default, you may want to change your "F12 for menu" option. Or, make a way to change it to something else.

Ah, didn't think of that. I use Scroll lock for starting Fraps, cause F12 is used by KSP for the Debug Menu.

Link to comment
Share on other sites

v1.1

-Added looping path functionality.

When you end a path, the time to return to the first point using your current velocity is calculated. Will look OK if it the end doesn't overshoot the start.

-Changed gui toggle hotkey to alt+F6 (Or Shift+F6 fo Linux people)

Link to comment
Share on other sites

v1.2

-Save and load paths to files.

-Alternate models can be defined for the paths by editing the path file for now.

Take care when loading a path to not occupy its starting position with your current vessel. Cause you will blow up.

The recording and manual play back is now the "work path". When a work path plane ends its run, it will fall out of the sky rather than be deleted, even if Go off rails at end" is marked.

Paths loaded from external files will play automatically, and the plane will either loop, be removed or fall out of the sky (go off rails) when the path ends.

Download new version

Menu explanation

Pl6qEsT.png

Record - Starts or continues recording to the work path.

Stop - Ends the recording. Also calculates the time to return the start for looping paths.

Clear - Clears then nodes, and adds the first node at the current location. Best used while recording is active.

Add node - For precise work like recording a stand still, or small ground movements, add nodes at the start and end of the stop to make it look better.

Loop path - If ON, the plane will return to the start of the path when it reaches the end, using the end speed.

Off rails at end - If the path isn't a loop, the plane will fall to the ground after the path ends. Otherwise it will be deleted. (Unless it's a work path playback)

Play - Plays the work path

OffRails - Makes the work path plane fall down

Save - saves the work path using the file name in the text box

Load - Opens up the path loading dialog

Link to comment
Share on other sites

I'm not home yet but You CAN choose the plane that flies the path, Right???

I just built a new private jet model. So other models and a selector are coming.

I'd love to combine this with KerbCam for some serious cinematic sequences, but I'm worried about compatibility issues since they both use pathing, do you know of any potential conflicts?

This thing is totally independent of not only other mods, but actually of any KSP logic at all. The only time it looks at any KSP code is when getting the current vessel position for recording.

Link to comment
Share on other sites

See that oddly angled plane with the low resolution texture and the struts all wrong?

That's not a vessel, it's a copy of the active vessel. Duplicated and following a path!

h0ySTQN.png

Copied vessels will have to have any struts removed, cause I'm not going to do those correctly, but other than that, this is looking good!

Link to comment
Share on other sites

When saving a craft (not a path), the plugin looks at the active vessel, and iterates through all its part. It makes a list, storing the part name, position, rotation and scale.

This is saved to a text file, independent from the paths. The paths can then be loaded with any saved craft schematic.

You bring up a good point. There's nothing stopping us from reusing this saved craft schematic in non-path uses, placed around the world for whatever use...

It's not a new model file though, so it's not KerbTown compatible for instance.

... I just flew a formation in my F-86 with a copy of it on a path next to me :)

Now I just gotta set up the file saving for the craft, which is easy, and then do a GUI overhaul to make the loading of all of these thing half way logical.

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...