forked from KSP-KOS/KOS_DOC
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbindings.html
More file actions
747 lines (670 loc) · 35.8 KB
/
bindings.html
File metadata and controls
747 lines (670 loc) · 35.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Catalog of Bound Variable Names — kOS 0.18.0 documentation</title>
<link rel="shortcut icon" href="_static/favicon.ico"/>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="author" title="About these documents"
href="about.html"/>
<link rel="copyright" title="Copyright" href="copyright.html"/>
<link rel="top" title="kOS 0.18.0 documentation" href="index.html"/>
<link rel="up" title="General Topics" href="general.html"/>
<link rel="next" title="CPU Vessel (SHIP)" href="general/cpu_vessel.html"/>
<link rel="prev" title="General Topics" href="general.html"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="index.html" class="fa fa-home"> kOS</a>
<div role="search">
<form id ="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="index.html">Home</a></li>
<li class="toctree-l1"><a class="reference internal" href="downloads_links.html">Downloads and Links</a><ul class="simple">
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="tutorials.html">Tutorials</a><ul>
<li class="toctree-l2"><a class="reference internal" href="tutorials/quickstart.html">Quick Start</a></li>
<li class="toctree-l2"><a class="reference internal" href="tutorials/designpatterns.html">Design Patterns</a></li>
<li class="toctree-l2"><a class="reference internal" href="tutorials/pidloops.html">PID Loops</a></li>
<li class="toctree-l2"><a class="reference internal" href="tutorials/exenode.html">Execute Node script</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="library.html">Community Example Library</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="general.html">General</a><ul class="current">
<li class="toctree-l2 current"><a class="current reference internal" href="">Bound Variables</a></li>
<li class="toctree-l2"><a class="reference internal" href="general/cpu_vessel.html">CPU Vessel (SHIP)</a></li>
<li class="toctree-l2"><a class="reference internal" href="general/cpu_hardware.html">CPU Hardware</a></li>
<li class="toctree-l2"><a class="reference internal" href="general/applauncher_panel.html">Launcher Panel</a></li>
<li class="toctree-l2"><a class="reference internal" href="general/telnet.html">Telnet Server</a></li>
<li class="toctree-l2"><a class="reference internal" href="general/volumes.html">Files & Volumes</a></li>
<li class="toctree-l2"><a class="reference internal" href="general/compiling.html">Machine Code</a></li>
<li class="toctree-l2"><a class="reference internal" href="general/nametag.html">Name Tags</a></li>
<li class="toctree-l2"><a class="reference internal" href="general/parts_and_partmodules.html">Parts & PartModules</a></li>
<li class="toctree-l2"><a class="reference internal" href="general/career_limits.html">Respecting Career Limits</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="language.html">Language</a><ul>
<li class="toctree-l2"><a class="reference internal" href="language/features.html">General Features</a></li>
<li class="toctree-l2"><a class="reference internal" href="language/syntax.html">Language Syntax</a></li>
<li class="toctree-l2"><a class="reference internal" href="language/flow.html">Flow Control</a></li>
<li class="toctree-l2"><a class="reference internal" href="language/variables.html">Variables</a></li>
<li class="toctree-l2"><a class="reference internal" href="language/user_functions.html">User Functions</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="math.html">Mathematics</a><ul>
<li class="toctree-l2"><a class="reference internal" href="math/basic.html">Fundamental Constants</a></li>
<li class="toctree-l2"><a class="reference internal" href="math/basic.html#mathematical-functions">Mathematical Functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="math/vector.html">Vectors</a></li>
<li class="toctree-l2"><a class="reference internal" href="math/direction.html">Directions</a></li>
<li class="toctree-l2"><a class="reference internal" href="math/geocoordinates.html">Geographic Coordinates</a></li>
<li class="toctree-l2"><a class="reference internal" href="math/ref_frame.html">Reference Frames</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="commands.html">Commands</a><ul>
<li class="toctree-l2"><a class="reference internal" href="commands/flight.html">Flight Control</a></li>
<li class="toctree-l2"><a class="reference internal" href="commands/prediction.html">Prediction</a></li>
<li class="toctree-l2"><a class="reference internal" href="commands/list.html">Listing Data</a></li>
<li class="toctree-l2"><a class="reference internal" href="commands/parts.html">Parts Information</a></li>
<li class="toctree-l2"><a class="reference internal" href="commands/files.html">File I/O</a></li>
<li class="toctree-l2"><a class="reference internal" href="commands/terminalgui.html">Terminal and GUI</a></li>
<li class="toctree-l2"><a class="reference internal" href="commands/resource_transfer.html"> Resource Transfer</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="structures.html">Structures</a><ul>
<li class="toctree-l2"><a class="reference internal" href="structures/orbits.html">Orbits</a></li>
<li class="toctree-l2"><a class="reference internal" href="structures/celestial_bodies.html">Celestial Bodies</a></li>
<li class="toctree-l2"><a class="reference internal" href="structures/vessels.html">Vessels & Parts</a></li>
<li class="toctree-l2"><a class="reference internal" href="structures/waypoint.html">Waypoints</a></li>
<li class="toctree-l2"><a class="reference internal" href="structures/misc.html">Miscellaneous</a></li>
<li class="toctree-l2"><a class="reference internal" href="structures/core.html">Core</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="addons.html">Addons</a><ul>
<li class="toctree-l2"><a class="reference internal" href="addons/AGX.html">Action Groups Extended</a></li>
<li class="toctree-l2"><a class="reference internal" href="addons/RemoteTech.html">RemoteTech</a></li>
<li class="toctree-l2"><a class="reference internal" href="addons/KAC.html">Kerbal Alarm Clock</a></li>
<li class="toctree-l2"><a class="reference internal" href="addons/IR.html">Infernal Robotics</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="contribute.html">Contribute</a><ul class="simple">
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="changes.html">Changes</a><ul class="simple">
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="about.html">About</a></li>
</ul>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">kOS</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> »</li>
<li><a href="general.html">General Topics</a> »</li>
<li>Catalog of Bound Variable Names</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/bindings.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document">
<div class="section" id="catalog-of-bound-variable-names">
<span id="bindings"></span><h1>Catalog of Bound Variable Names<a class="headerlink" href="#catalog-of-bound-variable-names" title="Permalink to this headline">¶</a></h1>
<p>This is the list of special reserved keyword variable names that kOS
will interpret
to mean something special. If they are used as normal variable names by
your kOS script
program they may not work. Understanding them and their meaning is
crucial to creating
effective kOS scripts.</p>
<div class="section" id="named-vessels-and-bodies">
<h2>NAMED VESSELS AND BODIES<a class="headerlink" href="#named-vessels-and-bodies" title="Permalink to this headline">¶</a></h2>
<p>SHIP:</p>
<div class="line-block">
<div class="line"><strong>Variable name</strong>: SHIP</div>
<div class="line"><strong>Gettable</strong>: yes</div>
<div class="line"><strong>Settable</strong>: no</div>
<div class="line"><strong>Type</strong>: <a class="reference external" href="structures/vessels/vessel.html">Vessel</a></div>
<div class="line"><strong>Description</strong>: Whichever vessel happens to be the one containing the CPU part that is running this Kerboscript code at the moment. This is the <a class="reference external" href="general/cpu_vessel.html">CPU Vessel</a>.</div>
</div>
<p>TARGET:</p>
<div class="line-block">
<div class="line"><strong>Variable Name</strong>: TARGET</div>
<div class="line"><strong>Gettable</strong>: yes</div>
<div class="line"><strong>Settable</strong>: yes</div>
<div class="line"><strong>Type</strong>: <a class="reference external" href="structures/vessels/vessel.html">Vessel</a> or <a class="reference external" href="structures/celestial_bodies/body.html">Body</a></div>
<div class="line"><strong>Description</strong>: Whichever <a class="reference external" href="structures/orbits/orbitable.html">Orbitable</a> object happens to be the one selected as the current KSP target. If set to a string, it will assume the string is the name of a vessel being targetted and set it to a vessel by that name. For best results set it to Body(“some name”) or Vessel(“some name”) explicitly.</div>
</div>
</div>
<div class="section" id="alias-shortcuts-for-ship-fields">
<h2>Alias shortcuts for SHIP fields<a class="headerlink" href="#alias-shortcuts-for-ship-fields" title="Permalink to this headline">¶</a></h2>
<p>The following are all alias shortcuts for accessing the fields of the
SHIP vessel.
To see their definition, please consult the
<a class="reference external" href="structures/vessels/vessel.html">Vessel</a>
page, as they are all just instances of the standard vessel suffixes.</p>
<table border="1" class="docutils">
<colgroup>
<col width="17%" />
<col width="83%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Variable</th>
<th class="head">Same as</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>HEADING</td>
<td>Same as SHIP:HEADING</td>
</tr>
<tr class="row-odd"><td>PROGRADE</td>
<td>Same as SHIP:PROGRADE</td>
</tr>
<tr class="row-even"><td>RETROGRADE</td>
<td>Same as SHIP:RETROGRADE</td>
</tr>
<tr class="row-odd"><td>FACING</td>
<td>Same as SHIP:FACING</td>
</tr>
<tr class="row-even"><td>MAXTHRUST</td>
<td>Same as SHIP:MAXTHRUST</td>
</tr>
<tr class="row-odd"><td>VELOCITY</td>
<td>Same as SHIP:VELOCITY</td>
</tr>
<tr class="row-even"><td>GEOPOSITION</td>
<td>Same as SHIP:GEOPOSITION</td>
</tr>
<tr class="row-odd"><td>LATITUDE</td>
<td>Same as SHIP:LATITUDE</td>
</tr>
<tr class="row-even"><td>LONGITUDE</td>
<td>Same as SHIP:LONGITUDE</td>
</tr>
<tr class="row-odd"><td>UP</td>
<td>Same as SHIP:UP</td>
</tr>
<tr class="row-even"><td>NORTH</td>
<td>Same as SHIP:NORTH</td>
</tr>
<tr class="row-odd"><td>BODY</td>
<td>Same as SHIP:BODY</td>
</tr>
<tr class="row-even"><td>ANGULARMOMENTUM</td>
<td>Same as SHIP:ANGULARMOMENTUM</td>
</tr>
<tr class="row-odd"><td>ANGULARVEL</td>
<td>Same as SHIP:ANGULARVEL</td>
</tr>
<tr class="row-even"><td>ANGULARVELOCITY</td>
<td>Same as SHIP:ANGULARVEL</td>
</tr>
<tr class="row-odd"><td>COMMRANGE</td>
<td>Same as SHIP:COMMRANGE</td>
</tr>
<tr class="row-even"><td>MASS</td>
<td>Same as SHIP:MASS</td>
</tr>
<tr class="row-odd"><td>VERTICALSPEED</td>
<td>Same as SHIP:VERTICALSPEED</td>
</tr>
<tr class="row-even"><td>GROUNDSPEED</td>
<td>Same as SHIP:GROUNDSPEED</td>
</tr>
<tr class="row-odd"><td>SURFACESPEED</td>
<td>This has been obsoleted as of kOS 0.18.0. Replace it with GROUNDSPEED.</td>
</tr>
<tr class="row-even"><td>AIRSPEED</td>
<td>Same as SHIP:AIRSPEED</td>
</tr>
<tr class="row-odd"><td>VESSELNAME</td>
<td>Same as SHIP:VESSELNAME</td>
</tr>
<tr class="row-even"><td>ALTITUDE</td>
<td>Same as SHIP:ALTITUDE</td>
</tr>
<tr class="row-odd"><td>APOAPSIS</td>
<td>Same as SHIP:APOAPSIS</td>
</tr>
<tr class="row-even"><td>PERIAPSIS</td>
<td>Same as SHIP:PERIAPSIS</td>
</tr>
<tr class="row-odd"><td>SENSORS</td>
<td>Same as SHIP:SENSORS</td>
</tr>
<tr class="row-even"><td>SRFPROGRADE</td>
<td>Same as SHIP:SRFPROGRADE</td>
</tr>
<tr class="row-odd"><td>SRFREROGRADE</td>
<td>Same as SHIP:SRFREROGRADE</td>
</tr>
<tr class="row-even"><td>OBT</td>
<td>Same as SHIP:OBT</td>
</tr>
<tr class="row-odd"><td>STATUS</td>
<td>Same as SHIP:STATUS</td>
</tr>
<tr class="row-even"><td>SHIPNAME</td>
<td>Same as SHIP:NAME</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="constants-pi-e-etc">
<h2>Constants (pi, e, etc)<a class="headerlink" href="#constants-pi-e-etc" title="Permalink to this headline">¶</a></h2>
<p>Get-only.</p>
<p>The variable <tt class="docutils literal"><span class="pre">constant</span></tt> provides a way to access a few
<a class="reference internal" href="math/basic.html#constants"><em>basic math and physics constants</em></a>, such as Pi, Euler’s
number, and so on.</p>
<p>Example:</p>
<div class="highlight-c"><div class="highlight"><pre><span class="n">print</span> <span class="s">"Kerbin's circumference: "</span> <span class="o">+</span> <span class="p">(</span><span class="mi">2</span><span class="o">*</span><span class="n">constant</span><span class="o">:</span><span class="n">pi</span><span class="o">*</span><span class="n">Kerbin</span><span class="o">:</span><span class="n">radius</span><span class="p">)</span> <span class="o">+</span> <span class="s">"meters."</span><span class="p">.</span>
</pre></div>
</div>
<p>The full list is here: <a class="reference internal" href="math/basic.html#constants"><em>constants page</em></a>.</p>
</div>
<div class="section" id="terminal">
<h2>Terminal<a class="headerlink" href="#terminal" title="Permalink to this headline">¶</a></h2>
<p>Get-only. <tt class="docutils literal"><span class="pre">terminal</span></tt> returns a <a class="reference internal" href="structures/misc/terminal.html#structure:TERMINAL" title="TERMINAL structure"><tt class="xref ks ks-struct docutils literal"><span class="pre">terminal</span></tt></a> structure describing
the attributes of the current terminal screen associated with the
CPU this script is running on.</p>
</div>
<div class="section" id="core">
<h2>Core<a class="headerlink" href="#core" title="Permalink to this headline">¶</a></h2>
<p>Get-only. <tt class="docutils literal"><span class="pre">core</span></tt> returns a <a class="reference internal" href="structures/core.html#structure:CORE" title="CORE structure"><tt class="xref ks ks-struct docutils literal"><span class="pre">core</span></tt></a> structure referring to the CPU you
are running on.</p>
</div>
<div class="section" id="stage">
<h2>Stage<a class="headerlink" href="#stage" title="Permalink to this headline">¶</a></h2>
<p>Get-only. <tt class="docutils literal"><span class="pre">stage</span></tt> returns a <a class="reference internal" href="structures/vessels/stage.html#structure:STAGE" title="STAGE structure"><tt class="xref ks ks-struct docutils literal"><span class="pre">stage</span></tt></a> structure used to count resources
in the current stage. Not to be confused with the COMMAND stage
which triggers the next stage.</p>
</div>
<div class="section" id="nextnode">
<h2>NextNode<a class="headerlink" href="#nextnode" title="Permalink to this headline">¶</a></h2>
<p>Get-only. <tt class="docutils literal"><span class="pre">nextnode</span></tt> returns the next planned manuever <tt class="xref ks ks-struct docutils literal"><span class="pre">node</span></tt> in the SHIP’s flight plan. Bombs out if no such node exists.</p>
</div>
<div class="section" id="resource-types">
<h2>Resource Types<a class="headerlink" href="#resource-types" title="Permalink to this headline">¶</a></h2>
<p>Any time there is a resource on the ship it can be queried. The
resources are the values that appear when you click on the upper-right
corner of the screen in the KSP window. <img alt="Resources" src="_images/resources.png" /></p>
<div class="highlight-c"><div class="highlight"><pre><span class="n">LIQUIDFUEL</span>
<span class="n">OXIDIZER</span>
<span class="n">ELECTRICCHARGE</span>
<span class="n">MONOPROPELLANT</span>
<span class="n">INTAKEAIR</span>
<span class="n">SOLIDFUEL</span>
</pre></div>
</div>
<p>All of the above resources can be queried using either the prefix SHIP
or STAGE, depending on whether you are trying to query how much is left
in the current stage or the entire ship:</p>
<p>How much liquid fuel is left in the entire ship:</p>
<div class="highlight-c"><div class="highlight"><pre><span class="n">PRINT</span> <span class="s">"There is "</span> <span class="o">+</span> <span class="n">SHIP</span><span class="o">:</span><span class="n">LIQUIDFUEL</span> <span class="o">+</span> <span class="s">" liquid fuel on the ship."</span><span class="p">.</span>
</pre></div>
</div>
<p>How much liquid fuel is left in just the current stage:</p>
<div class="highlight-c"><div class="highlight"><pre><span class="n">PRINT</span> <span class="s">"There is "</span> <span class="o">+</span> <span class="n">STAGE</span><span class="o">:</span><span class="n">LIQUIDFUEL</span> <span class="o">+</span> <span class="s">" liquid fuel in this stage."</span><span class="p">.</span>
</pre></div>
</div>
<p>How much liquid fuel is left in the target vessel:</p>
<div class="highlight-c"><div class="highlight"><pre><span class="n">PRINT</span> <span class="s">"There is "</span> <span class="o">+</span> <span class="n">TARGET</span><span class="o">:</span><span class="n">LIQUIDFUEL</span> <span class="o">+</span> <span class="s">" liquid fuel in the target ship."</span><span class="p">.</span>
</pre></div>
</div>
<p>Any other resources that you have added using other mods should be
query-able this way, provided that you spell
the term exactly as it appears in the resources window.</p>
<p>You can also get a list of all resources, either in SHIP: or STAGE: with the :RESOURCES suffix.</p>
</div>
<div class="section" id="alt-alias">
<h2>ALT ALIAS<a class="headerlink" href="#alt-alias" title="Permalink to this headline">¶</a></h2>
<p>The special variable <a class="reference external" href="structures/vessels/alt.html">ALT</a> gives you
access to a few altitude predictions:</p>
<p>ALT:APOAPSIS</p>
<p>ALT:PERIAPSIS</p>
<p>ALT:RADAR</p>
<p>Further details are found on the <a class="reference external" href="structures/vessels/alt.html">ALT page</a> .</p>
</div>
<div class="section" id="eta-alias">
<h2>ETA ALIAS<a class="headerlink" href="#eta-alias" title="Permalink to this headline">¶</a></h2>
<p>The special variable <a class="reference external" href="structures/vessels/eta.html">ETA</a> gives you
access to a few time predictions:</p>
<p>ETA:APOAPSIS</p>
<p>ETA:PERIAPSIS</p>
<p>ETA:TRANSITION</p>
<p>Further details are found on the <a class="reference external" href="structures/vessels/eta.html">ETA page</a> .</p>
</div>
<div class="section" id="encounter">
<h2>ENCOUNTER<a class="headerlink" href="#encounter" title="Permalink to this headline">¶</a></h2>
<p>The orbit patch describing the next encounter with a body the current
vessel will enter. If there is no such encounter coming, it will return
the special string “None”. If there is an encounter coming, it will
return an object <a class="reference internal" href="structures/orbits/orbit.html#orbit"><em>of type Orbit</em></a>. (i.e. to obtain the name
of the planet the encounter is with, you can do:
<tt class="docutils literal"><span class="pre">print</span> <span class="pre">ENCOUNTER:BODY:NAME.</span></tt>, for example.).</p>
</div>
<div class="section" id="boolean-toggle-fields">
<h2>BOOLEAN TOGGLE FIELDS:<a class="headerlink" href="#boolean-toggle-fields" title="Permalink to this headline">¶</a></h2>
<p>These are variables that behave like boolean flags. They can be True or
False, and can be set or toggled
using the “ON” and “OFF” and “TOGGLE” commands.
Many of these are for action group flags.
<strong>NOTE ABOUT ACTION GROUP FLAGS:</strong> If the boolean flag is for an action
group, be aware that each time the
user presses the action group keypress, it <em>toggles</em> the action group,
so you might need to check for both
the change in state from false to true AND the change in state from true
to false to see if the key was hit.</p>
<table border="1" class="docutils">
<colgroup>
<col width="9%" />
<col width="6%" />
<col width="6%" />
<col width="80%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Variable Name</th>
<th class="head">Can Read</th>
<th class="head">Can Set</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>SAS</td>
<td>yes</td>
<td>yes</td>
<td>(Same as “SAS” indicator on the navball.)</td>
</tr>
<tr class="row-odd"><td>RCS</td>
<td>yes</td>
<td>yes</td>
<td>(Same as “RCS” indicator on the navball.)</td>
</tr>
<tr class="row-even"><td>GEAR</td>
<td>yes</td>
<td>yes</td>
<td>Is the GEAR enabled right now? (Note, KSP does some strange things with this flag, like needing to hit it twice the first time).</td>
</tr>
<tr class="row-odd"><td>LEGS</td>
<td>yes</td>
<td>yes</td>
<td>Are the landing LEGS extended? (as opposed to GEAR which is for the wheels of a plane.)</td>
</tr>
<tr class="row-even"><td>CHUTES</td>
<td>yes</td>
<td>yes</td>
<td>Are the parachutes extended? (Treats all parachutes as one single unit. Does not activate them individually.)</td>
</tr>
<tr class="row-odd"><td>LIGHTS</td>
<td>yes</td>
<td>yes</td>
<td>Are the lights on? (like the “U” key in manual flight.)</td>
</tr>
<tr class="row-even"><td>PANELS</td>
<td>yes</td>
<td>yes</td>
<td>Are the solar panels extended? (Treats all solar panels as one single unit. Does not activate them individually.)</td>
</tr>
<tr class="row-odd"><td>BRAKES</td>
<td>yes</td>
<td>yes</td>
<td>Are the brakes on?</td>
</tr>
<tr class="row-even"><td>ABORT</td>
<td>yes</td>
<td>yes</td>
<td>Abort Action Group.</td>
</tr>
<tr class="row-odd"><td>AG1</td>
<td>yes</td>
<td>yes</td>
<td>Action Group 1.</td>
</tr>
<tr class="row-even"><td>AG2</td>
<td>yes</td>
<td>yes</td>
<td>Action Group 2.</td>
</tr>
<tr class="row-odd"><td>AG3</td>
<td>yes</td>
<td>yes</td>
<td>Action Group 3.</td>
</tr>
<tr class="row-even"><td>AG4</td>
<td>yes</td>
<td>yes</td>
<td>Action Group 4.</td>
</tr>
<tr class="row-odd"><td>AG5</td>
<td>yes</td>
<td>yes</td>
<td>Action Group 5.</td>
</tr>
<tr class="row-even"><td>AG6</td>
<td>yes</td>
<td>yes</td>
<td>Action Group 6.</td>
</tr>
<tr class="row-odd"><td>AG7</td>
<td>yes</td>
<td>yes</td>
<td>Action Group 7.</td>
</tr>
<tr class="row-even"><td>AG8</td>
<td>yes</td>
<td>yes</td>
<td>Action Group 8.</td>
</tr>
<tr class="row-odd"><td>AG9</td>
<td>yes</td>
<td>yes</td>
<td>Action Group 9.</td>
</tr>
<tr class="row-even"><td>AG10</td>
<td>yes</td>
<td>yes</td>
<td>Action Group 10.</td>
</tr>
<tr class="row-odd"><td>AGn</td>
<td>yes</td>
<td>yes</td>
<td>If you have the Action Groups Extended mod installed, you can access its groups the same way, i.e. AG11, AG12, AG13, etc.</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="flight-control">
<h2>Flight Control<a class="headerlink" href="#flight-control" title="Permalink to this headline">¶</a></h2>
<p>There are bound variables used in controlling the flight of a ship, which
can be found at the following links:</p>
<p>If you want to let kOS do a lot of the work of aligning to a desired
heading for you, use <a class="reference external" href="commands/flight/cooked.html">Cooked Control</a>.</p>
<p>If you want your script to manipulate the controls directly (as in “set
yaw axis halfway left for a few seconds (using the ‘A’ key)”, then
use <a class="reference external" href="commands/flight/raw.html">Raw Control</a>.</p>
<p>If you want to be able to READ what the player is attempting to do
while your script is running, and perhaps respond to it, then use
<a class="reference external" href="commands/flight/pilot.html">Reading the Pilot’s Control settings (i.e reading what the manual input is attempting)</a>
(By default your script will override manual piloting attempts, but
you can read what the pilot’s controls are set at and make your
autopilot take them under advisement - sort of like how a
fly-by-wire plane works.)</p>
<div class="section" id="controls-that-must-be-used-with-lock">
<h3>Controls that must be used with LOCK<a class="headerlink" href="#controls-that-must-be-used-with-lock" title="Permalink to this headline">¶</a></h3>
<div class="highlight-c"><div class="highlight"><pre><span class="n">THROTTLE</span> <span class="c1">// Lock to a decimal value between 0 and 1.</span>
<span class="n">STEERING</span> <span class="c1">// Lock to a direction, either a Vector or a Direction.</span>
<span class="n">WHEELTHROTTLE</span> <span class="c1">// Separate throttle for wheels</span>
<span class="n">WHEELSTEERING</span> <span class="c1">// Separate steering system for wheels</span>
</pre></div>
</div>
</div>
</div>
<div class="section" id="time">
<h2>Time<a class="headerlink" href="#time" title="Permalink to this headline">¶</a></h2>
<p><a class="reference external" href="structures/misc/time.html">Time</a> is the simulated amount of time that passed since the beginning of the game’s universe epoch. (A brand new campaign that just started begins at TIME zero.)</p>
<p>TIME is a useful system variable for calculating the passage of time
between taking
physical measurements (i.e. to calculate how fast a phenomenon is
changing in a loop).
It returns the KSP <em>simulated</em> time, rather than the actual realtime
sitting in the
chair playing the game. If everything is running smoothly on a fast
computer, one
second of simulated time will match one second of real time, but if
anything is
causing the game to stutter or lag a bit, then the simulated time will
be a bit
slower than the real time. For any script program trying to calculate
physical
properties of the KSP universe, the time that matters is the simulated
time, which
is what TIME returns.</p>
<p>It’s important to be aware of the <a class="reference external" href="general/CPU_hardware.html#FROZEN">frozen update
nature</a> of the kOS
computer when reading TIME.</p>
</div>
<div class="section" id="system-variables">
<h2>System Variables<a class="headerlink" href="#system-variables" title="Permalink to this headline">¶</a></h2>
<p>This section is about variables that describe the things that are slightly
outside the simulated universe of the game and are more about
the game’s user interface or the kOS mod itself. They represent things
that slightly “break the fourth wall” and let your script access
something entirely outside the in-character experience.</p>
<div class="highlight-c"><div class="highlight"><pre><span class="n">PRINT</span> <span class="n">VERSION</span><span class="p">.</span> <span class="c1">// Returns operating system version number. e.g. 0.8.6</span>
<span class="n">PRINT</span> <span class="n">VERSION</span><span class="o">:</span><span class="n">MAJOR</span><span class="p">.</span> <span class="c1">// Returns major version number. e.g. 0</span>
<span class="n">PRINT</span> <span class="n">VERSION</span><span class="o">:</span><span class="n">MINOR</span><span class="p">.</span> <span class="c1">// Returns minor version number. e.g. 8</span>
<span class="n">PRINT</span> <span class="n">VERSION</span><span class="o">:</span><span class="n">BUILD</span><span class="p">.</span> <span class="c1">// Returns build version number. e.g. 6</span>
<span class="n">PRINT</span> <span class="n">SESSIONTIME</span><span class="p">.</span> <span class="c1">// Returns amount of time, in seconds, from vessel load.</span>
</pre></div>
</div>
<p>NOTE the following important difference:</p>
<p>SESSIONTIME is the time since the last time this vessel was loaded from
on-rails into full physics.</p>
<p>TIME is the time since the entire saved game campaign started, in the
kerbal universe’s time. i.e. TIME = 0 means a brand new campaign was
just started.</p>
<div class="section" id="config">
<h3>Config<a class="headerlink" href="#config" title="Permalink to this headline">¶</a></h3>
<p>CONFIG is a special variable name that refers to the configuration
settings for the kOS mod, and can be used to set or get various
options.</p>
<p><a class="reference external" href="structures/misc/config.html">CONFIG has its own page</a> for further
details.</p>
</div>
<div class="section" id="warp-and-warpmode">
<h3>WARP and WARPMODE<a class="headerlink" href="#warp-and-warpmode" title="Permalink to this headline">¶</a></h3>
<p>Time warp can be controlled with the variables
WARP and WARPMODE. See <a class="reference internal" href="commands/flight/warp.html#warp"><em>WARP</em></a></p>
</div>
<div class="section" id="mapview">
<h3>MAPVIEW<a class="headerlink" href="#mapview" title="Permalink to this headline">¶</a></h3>
<p>A boolean that is both gettable and settable.</p>
<p>If you query MAPVIEW, it’s true if on the map screen, and false if on the flight view screen. If you SET MAPVIEW, you can cause the game to switch between mapview and flight view or visa versa.</p>
</div>
<div class="section" id="loaddistance">
<h3>LOADDISTANCE<a class="headerlink" href="#loaddistance" title="Permalink to this headline">¶</a></h3>
<p>LOADDISTANCE sets the distance from the active vessel at
which vessels get removed from the full physics engine and put
on-rails, or visa versa. Note that as of KSP 1.0 the stock game
supports multiple different load distance settings for different
situations such that the value changes depending on where you are.
But kOS does not support this at the moment so in kOS if you set
the LOADDISTANCE, you are setting it to the same value
universally for all situations.</p>
</div>
</div>
<div class="section" id="solarprimevector">
<span id="id1"></span><h2>SOLARPRIMEVECTOR<a class="headerlink" href="#solarprimevector" title="Permalink to this headline">¶</a></h2>
<p>Gives the Prime Meridian <a class="reference internal" href="math/vector.html#structure:VECTOR" title="VECTOR structure"><tt class="xref ks ks-struct docutils literal"><span class="pre">Vector</span></tt></a> for the Solar System itself, in
current Ship-Raw XYZ coordinates.</p>
<p>Both the <a class="reference internal" href="structures/orbits/orbit.html#attribute:ORBIT:LONGITUDEOFASCENDINGNODE" title="ORBIT:LONGITUDEOFASCENDINGNODE attribute"><tt class="xref ks ks-attr docutils literal"><span class="pre">Orbit:LONGITUDEOFASCENDINGNODE</span></tt></a> orbit suffix and the
<a class="reference internal" href="structures/celestial_bodies/body.html#attribute:BODY:ROTATIONANGLE" title="BODY:ROTATIONANGLE attribute"><tt class="xref ks ks-attr docutils literal"><span class="pre">Body:ROTATIONANGLE</span></tt></a> body suffix are expressed in terms of
degree offsets from this <em>Prime Meridian Reference Vector</em>.</p>
<div class="section" id="what-is-the-solar-prime-reference-vector">
<h3>What is the Solar Prime Reference Vector?<a class="headerlink" href="#what-is-the-solar-prime-reference-vector" title="Permalink to this headline">¶</a></h3>
<p>The solar prime vector is an arbitrary vector in space used to measure
some orbital parameters that are supposed to remain fixed to space
regardless of how the planets underneath the orbit rotate, or where the
Sun is. In a sense it can be thought of as the celestial “prime
meridian” of the entire solar system, rather than the “prime meridian” of
any one particular rotating planet or moon.</p>
<p>In a hypothetical Earthling’s solar system our Kerbal scientists have
hypothesized may exist in a galaxy far away, Earthbound astronomers use
a reference they called the
<a class="reference external" href="https://en.wikipedia.org/wiki/First_Point_of_Aries">First Point of Aries</a>,
for this purpose.</p>
<p>For Kerbals, it refers to a more arbitrary line in space, pointing at a fixed
point in the firmament, also known as the “skybox”.</p>
</div>
</div>
<div class="section" id="addons">
<h2>Addons<a class="headerlink" href="#addons" title="Permalink to this headline">¶</a></h2>
<p>Get-only. <tt class="docutils literal"><span class="pre">addons</span></tt> is a special variable used to access various extensions
to kOS that are designed to support the features introduced by some other mods. More info can be found on the <a class="reference internal" href="addons.html#addons"><em>addons</em></a> page.</p>
</div>
<div class="section" id="colors">
<h2>Colors<a class="headerlink" href="#colors" title="Permalink to this headline">¶</a></h2>
<p>There are several bound variables associated with <a class="reference internal" href="structures/misc/colors.html#colors"><em>hardcoded colors</em></a> such as WHITE, BLACK, RED, etc. See the linked page for the full list.</p>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="general/cpu_vessel.html" class="btn btn-neutral float-right" title="CPU Vessel (SHIP)">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="general.html" class="btn btn-neutral" title="General Topics"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
© <a href="copyright.html">Copyright</a> 2013-2015, Developed and maintained by kOS Team, Originally By Nivekk.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'0.18.0',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>