Jump to content

Can Kerbal add-ons make http requests?


ka3lin

Recommended Posts

Hey everyone! Quick question... Is it possible to create add-ons/plugins for KSP that make GET/POST requests to an API?

Use cases include creating GUIs with buttons to:

  • upload your craft file to an API
  • download a craft file from an API
  • get / post other metadata to an API

Thanks for quick help!

Link to comment
Share on other sites

I think it's possible, an add-on/plugin is just some C# code running in an Unity engine.
You can try doing following things to find the answer by yourself.
Write a simple plugin to:

  • upload a file to a local file server
  • download a webpage, e.g. google.com
  • send a get/post request to any website, e.g. google.com

I guess the final answer is YES.

Link to comment
Share on other sites

@Xavier513 Yes, that's exactly what I was thinking. I will try this out for myself. :)

 

@Stone Blue Wow, seeing kerbalx.com is super helpful! I had no idea this exists. This is great because it gives me some analogous ideas of what's possible.

 

Follow-up question for either of you... Is it possible to automatically display a 3D render of a craft without having a player need to upload an image like kerbalx? For example: Kerbal uploads craft file through via POST request -> Backend rendering pipeline turns craft file in a 3D render or somehow takes a screenshot to be displayed.

Link to comment
Share on other sites

hmm.. now you're talking *code*... which is all Greek to me :P

I can think of some mods, that I think do *some* of what youre talking... but no idea if exactly what youre talking, or if what they do could be useful or integrated into *one* thing

Edited by Stone Blue
Link to comment
Share on other sites

3 hours ago, ka3lin said:

@Xavier513 Yes, that's exactly what I was thinking. I will try this out for myself. :)

 

@Stone Blue Wow, seeing kerbalx.com is super helpful! I had no idea this exists. This is great because it gives me some analogous ideas of what's possible.

 

Follow-up question for either of you... Is it possible to automatically display a 3D render of a craft without having a player need to upload an image like kerbalx? For example: Kerbal uploads craft file through via POST request -> Backend rendering pipeline turns craft file in a 3D render or somehow takes a screenshot to be displayed.

It seems like you're partly describing the functionality of a mod like Kronal Vessel Viewer (which is used to generate tons of the aircraft images on KerbalX, for instance)  which provides real-time in-game rendering options. Most famously for status wireframe renderings in flight, etc.

Not sure if this is the latest version:

 

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