gisikw / ksprogramming

Getting to space with kOS!
https://www.youtube.com/playlist?list=PLb6UbFXBdbCrvdXVgY_3jp5swtvW24fYv
MIT License
99 stars 17 forks source link

Thank you for your tutorials #2

Closed TheDude044 closed 8 years ago

TheDude044 commented 9 years ago

Thank you for your tutorials! I wanted to try this mod long ago. But there were no proper tutorials for people that don't have programming background.

I've started a career with very hard seetings. All science on Kerbin is already gathered, but I haven't unlocked RT long range antennae and solar panels, action groups int the VAB, but I have kOS computer. The only way to reach Mun is to use kOS. I actually managed to create a Mun fly-by and return 18t and 30 parts limit rocket. And thanks to you I created a fully automated mission.

But I have some questions: 1). How to make your craft gather science automatically (I have no action groups, so TOGGLE ... is not an option). I've read about part modules, but there are no examples. English is not my mother-tongue, so it's a bit difficult to understand the official kOS docs. Would you give me an example for PresMat Barometer. 2). How to order your craft to stop the electric charge flow? (right-click on the part, green arrow icon)?

gisikw commented 8 years ago

Sorry for the delay in responding, but glad you've been enjoying the series!

KOS has released a new version which lets you gather science much more efficiently - you can take a look at their docs here: http://ksp-kos.github.io/KOS_DOC/structures/vessels/scienceexperiment.html

As far as manipulating electric charge flow...you'll want to first get the part, and then examine its resources. You can set ENABLED to true or false, which should do what you want to do.

So, for example: SET SHIP:PARTSDUBBED("Z-100 Rechargeable Battery Pack")[0]:RESOURCES[0]:ENABLED TO FALSE. will disable the first Z-100 pack it happens to come across in the list of parts. You probably want to tag the part in the VAB/SPH first though, so you know you're always toggling the right one. It's never fun to accidentally lose power!

TheDude044 commented 8 years ago

THANKS!!!