To use the Archive, first we’ll have to introduce you to a new command, called SWITCH TO. ALSO, it actually exists across saved games - if you launch one saved game, put a new file in the Archive, and then later launch a different saved game, that file will be there in that game too. It has infinite storage space, and does not disappear when your vessel is gone. The archive is conceptually stored somewhere back at Kerbin home base in the Space Center rather than on your vessel. There is another VOLUME that always exists called the Archive, which is also referred to as volume 0. Can’t I save it somewhere better? More permanent? ¶ Step 8: I don’t like the idea that the program is stored only on this vessel. This is important because it means you can’t access the program from another vessel, and if this vessel ever crashes and the SCS part explodes, then you’ve lost the program. If you’re wondering where the file is stored physically on your computer, it’s represented by a section inside the persistence file for your saved game, as a piece of data associated with the SCS part. Local volumes such at this tend to have very small limited storage, as you can see when you look at the space remaining in the list printout. This is the local volume of that SCS part. By default, when you launch a new vessel, the currently selected VOLUME is called “1” and it’s the volume that’s stored on THAT SCS part that you are running all these commands in. This is a list of all the files on the currently selected VOLUME. It should look like this, showing you the HELLO program you just wrote: (Note, that the default for the LIST command is to list FILES, so you can leave the word “FILES” off if you like.) You should now see an old-school looking text terminal like the one shown below. Step 5: See what an interactive command is like ¶ To switch back to manual control of the game instead of typing into the terminal, click outside the terminal window anywhere on the background of the screen. In other words if you type W A S D, you’ll actually get the word “wasd” to appear on the terminal, rather than the W A S D keys steering the ship. If you click on the terminal, then your keyboard input is directed to the terminal INSTEAD of to piloting. Note that if the terminal is semi-transparent, this means it’s not currently selected. Right click for the SCS part on the vessel and then click the button that says “Open Terminal”. For this first example it doesn’t matter if the vessel can actually liftoff or even has engines at all. (From this point onward the CX-4181 Scriptable Control System part will be referred to by the acronym “SCS”.) The SCS part is located in the parts bin under the “Control” tab (the same place where RCS thrusters and Torque Wheels are found.) Step 3: Put the vessel on the launchpad ¶ Make the vessel contain any unmanned command core, a few hundred units of battery power, a means of recharging the battery such as a solar panel array, and the “Comptronix CX-4181 Scriptable Control System”. (You can use kOS in a career mode game, but it requires a part that you have to research which isn’t available at the start of the tech tree, so this example will just use sandbox mode to keep it simple.) Step 2: Make a vessel in the Vehicle Assembly Bay ¶ The purpose of this example is to show where you should put the files, how to move them about, and how to get one to run on the vessel. In the grand tradition of programming tutorials, the first example will be how to make a script that does nothing more than print the words “Hello World” on the screen. Step 4: Make the script actually control steering Step 3: Make the script actually do something Can’t I save it somewhere better? More permanent? Step 6: Okay that’s great, but how can you make that happen in a program script instead? Step 5: See what an interactive command is like Step 2: Make a vessel in the Vehicle Assembly Bay
0 Comments
Leave a Reply. |