Skip to content

Commit

Permalink
Changes in prep for kOS v1.4.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Dunbaratu committed Feb 11, 2023
1 parent 00f5844 commit 9fab0b6
Show file tree
Hide file tree
Showing 12 changed files with 302 additions and 30 deletions.
201 changes: 200 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,205 @@
kOS Mod Changelog
=================

# v1.4.0.0 - Catch-up for over a year of little things

It's been 3 years since the last kOS release, and a lot of
small changes have trickled in. None were big enough on
their own for a full release but there's been enough of
them and it's been long enough that a release has been
needed for a while now. Since KSP 2 is about to start
hitting early access, it seemed right to get all these little
things out for kOS for KSP 1 just before that happens.

This will also make it so people won't have to keep
overriding the complaints of CKAN for trying to use
kOS on KSP 1.11.x or KSP 1.12.x. (Which it worked for
but CKAN didn't know that. Now it should know that.)

### BREAKING CHANGES

- The bugfix to prevent a local variable from clobbering a
builtin name could make existing scripts have to rename
a variable or two.

Previously if you tried to create a variable that matches
the name of a built-in variable, it would let you but then
the built-in variable would be permanently masked and
unreachable.

Now by default it won't let you. BUT you can get the old
behavior back again if you use the @CLOBBERBUILTINS directive,
if you really want to let yourself do that.
[pull request](https://github.com/KSP-KOS/KOS/pull/3016)

### NEW FEATURES

- kOS parts are now findable by typing "kos" into the
VAB's part search bar.
[pull request](https://github.com/KSP-KOS/KOS/pull/2980)

- kOS parts can be placed inside the KSP cargo inventory system.
[pull request](https://github.com/KSP-KOS/KOS/pull/2916)

- Comma-separated list of LOCAL or SET declarations can
now be parsed. Example:

old: ``local a is 3. local b is 5. local c is 10.``
can now be: ``local a is 3, b is 5, c is 10.``

This is similar to how it works with PARAMETER.
[pull request](https://github.com/KSP-KOS/KOS/pull/2975)

- Added VESSEL:THRUST, VESSEL:ENGINES, VESSEL:RCS.

``VESSEL:THRUST`` is the sum of the engine:THRUST of all
the engines.

``VESSEL:ENGINES`` is the same list returned by LIST ENGINES,
but using a somewhat nicer syntax.

``VESSEL:RCS`` is the list of all the RCS parts on the vessel.
[pull request](https://github.com/KSP-KOS/KOS/pull/2977)

- Added OPCODESLEFT bound variable. This bound variable
returns the number of instructions yet to execute (how
much of CONFIG:IPU's instructions there are to go in
this fixedupdate). Intended to help decide if a `WAIT 0.`
would be prudent before entering a critical section of
code.
[pull request](https://github.com/KSP-KOS/KOS/pull/2890)

- Better integration with RP-1's avionics tech progression.
(No longer have to buy into the tech from the R&D building
to cause the kOS cores in avionics parts to get the upgrade.)
[pull request](https://github.com/KSP-KOS/KOS/pull/2955)

- Better integration with RP-1's avionics lockouts when the
avionics doesn't support the mass. (Previously kOS couldn't
use ANY of the controls when avionics were insufficient, even
ones RP-1 meant to still work with insuficient avionics,
like RCS fore and aft.)
[pull request](https://github.com/KSP-KOS/KOS/pull/2971)

- kOS parts are now findable by typing "kos" into the
VAB's part search bar.
[pull request](https://github.com/KSP-KOS/KOS/pull/2980)

- Can now read a binary file as a LIST of numeric values (one
per byte).
[pull request](https://github.com/KSP-KOS/KOS/pull/2986)

### BUG FIXES

- Documentation: Many small one-line documentation fixes that are
too numerous to mention all of them one by one.
[pull request](https://github.com/KSP-KOS/KOS/pull/2886)
[pull request](https://github.com/KSP-KOS/KOS/pull/2951)
[pull request](https://github.com/KSP-KOS/KOS/pull/2960)
[pull request](https://github.com/KSP-KOS/KOS/pull/2962)
[pull request](https://github.com/KSP-KOS/KOS/pull/2967)
[pull request](https://github.com/KSP-KOS/KOS/pull/3070)

- A change to make it backward compatible with a call
kOSPropMonitor was doing.
[pull request](https://github.com/KSP-KOS/KOS/pull/2865)

- Cause the mod RocketSoundEnhancement to stop muffling
kOS's sounds. (By explicitly telling Unity those
sounds don't emit from the kOS Part's "location" and
instead are ambient.)
[pull request](https://github.com/KSP-KOS/KOS/pull/2866)

- Make PART:DECOUPLER behave more consistently with what the
documentation says about docking ports.
[pull request](https://github.com/KSP-KOS/KOS/pull/2864)

- Reduce excessive repeats of GUI ONCONFIRM calls being triggered
when they werent' supposed to be triggered.
[pull request](https://github.com/KSP-KOS/KOS/pull/2872)

- Remove legacy old version of kOS's computer from the parts
definition file so it can't appear by accident in the parts bin.
This is no longer needed for backward compatibility like it
was before because this version of kOS cannot run on the
very old versions of KSP that part was for anyway.
[pull request](https://github.com/KSP-KOS/KOS/pull/2893)

- When reporting the terrainheight of a geoposition, it no
longer returns false results caused by seeing certain
stock parts that put trigger colliders on the "terrain layer".
[pull request](https://github.com/KSP-KOS/KOS/pull/2900)

- Fix SteeringManager believing RCS blocks were capable of
more thrust than they were (causing steering to be tuned
wrong when steering via RCS). Problem was caused when stock
parts now have multiple alternate RCS nozzle arrangements,
and kOS was summing up all the thrust all the nozzle variants
can do even though only a subset of those nozzles actually
exist in any given variant.
[pull request](https://github.com/KSP-KOS/KOS/pull/2923)
[pull request](https://github.com/KSP-KOS/KOS/pull/2974)

- When setting the volume name for a disk drive by copying the
vessel's name to the volume's name, it now strips out
characters that are not allowed in volume names (but are
in vessel names, thus the bug).
[pull request](https://github.com/KSP-KOS/KOS/pull/2944)

- BOUNDS now does a better job of calculating based on
part's *colliders* rather than their visual meshes which
don't always agree with the colliders.
[pull request](https://github.com/KSP-KOS/KOS/pull/2945)

- No longer bogs down as much when someone creates the same
LOCK expression repeatedly in a loop. (Still not a good idea,
but kOS tolerates it better now.)
[pull request](https://github.com/KSP-KOS/KOS/pull/2965)

- Performance: No longer pays the cost of tracking a stopwatch
when the user doesn't even have profiling turned on so they're
not looking at the timings anyway.
[pull request](https://github.com/KSP-KOS/KOS/pull/2969)

- A VOICE's volume is now persisting properly after playing a
NOTE. Previously playing the NOTE caused the VOICE volume
setting to get clobbered by the NOTE's volume.
[pull request](https://github.com/KSP-KOS/KOS/pull/2978)

- Make it so kOS's ModuleCargoPart settings don't break in
older KSP 1.10.x (which doesn't have ModuleCargoPart).
[pull request](https://github.com/KSP-KOS/KOS/pull/3003)

- Fix a bug when a thing that is locked is used as the
left side of a suffix when setting the suffix.
[pull request](https://github.com/KSP-KOS/KOS/pull/3010)

- Prevent a local variable from clobbering a builtin name
[pull request](https://github.com/KSP-KOS/KOS/pull/3016)

- Allow kOS code to "see" a change to a manuever node's ETA
made outside the script, after having obtained the node
in a variable.
[pull request](https://github.com/KSP-KOS/KOS/pull/3040)

- Fix Compiler exceptions not showing the filename correctly.
[pull request](https://github.com/KSP-KOS/KOS/issues/3018)

- Fix ALT:RADAR sometimes wrong when high above ground.
[pull request](https://github.com/KSP-KOS/KOS/issues/2902)

- Fix race condition that caused terminal to spam the log
on scene changes and sometimes spam the log enough to
lag the game for some people.
[pull request](https://github.com/KSP-KOS/KOS/issues/2925)

- Fix throwing exception when setting SASMODE while the
navball is hidden.
[pull request](https://github.com/KSP-KOS/KOS/issues/3045)

- Made the doc generation scripts work on python 3.x
[pull request](https://github.com/KSP-KOS/KOS/issues/3069)

# v1.3.2.0 - Don't Steer Me wronger

A quick patch to v1.3.0.0 that fixes issue #2857 that would
Expand All @@ -10,7 +209,7 @@ reboot had occurred while raw controls were in use. Most
players won't notice a single physics frame of zeroed
controls, but if you're using realism mods with limited
engine ignitions, it would unfairly consume an engine
ignition when the throttle zeroed for an instant. (Which

was disasterous for those engines that only get one
ignition.)

Expand Down
10 changes: 5 additions & 5 deletions Resources/GameData/kOS/kOS.version
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@
},
"VERSION": {
"MAJOR": 1,
"MINOR": 3,
"PATCH": 2,
"MINOR": 4,
"PATCH": 0,
"BUILD": 0
},
"KSP_VERSION": {
"MAJOR": 1,
"MINOR": 10,
"MINOR": 12,
"PATCH": 1
},
"KSP_VERSION_MIN": {
"MAJOR": 1,
"MINOR": 10,
"MINOR": 12,
"PATCH": 0
},
"KSP_VERSION_MAX": {
"MAJOR": 1,
"MINOR": 11,
"MINOR": 12,
"PATCH": 99
}
}
33 changes: 27 additions & 6 deletions doc/ksdomain.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,33 @@ def add_target_and_index(self, name, sig, signode):
objects = self.env.domaindata['ks']['objects']
key = (self.objtype, name.upper())
if key in objects:
self.env.warn(self.env.docname,
'duplicate description of %s %s, ' %
(self.objtype, name.upper()) +
'other instance in ' +
self.env.doc2path(objects[key]),
self.lineno)
# this previously used:
# self.env.warn()
# But that apparently doesn't exist anymore in
# Sphinx and I couldn't find with Google any
# examples of what you're supposed to update it to
# use instead from Sphinx.
# So I just replced it with a few dumb print
# statements so at least it won't crash and will
# show the actual message on screen:
#
# If anyone else can figure out what sphinx changed
# self.app.warn() to that should be used here
# instead, great - go ahead and fix this kludge:
print(".------ WARNING ----------")
print("| Warning in " + self.env.docname + " line", end=" ")
print(f"line {self.lineno}")
print("| duplicate description of ")
print("| " + self.objtype + " " + name.upper())
print("| other instance in ")
print("| " + self.env.doc2path(objects[key]))
print("`-------------------------")
#self.app.warn(self.env.docname,
# 'duplicate description of %s %s, ' %
# (self.objtype, name.upper()) +
# 'other instance in ' +
# self.env.doc2path(objects[key]),
# self.lineno)

objects[key] = self.env.docname
indextext = self.get_index_text(self.objtype, name)
Expand Down
1 change: 1 addition & 0 deletions doc/make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ if "%1" == "help" (
if "%1" == "clean" (
for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
del /q /s %BUILDDIR%\*
del /q /s gh-pages\*
goto end
)

Expand Down
20 changes: 16 additions & 4 deletions doc/source/bindings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -532,13 +532,25 @@ for this purpose.
For Kerbals, it refers to a more arbitrary line in space, pointing at a fixed
point in the firmament, also known as the "skybox".

.. _opcodesleft:

OPCODESLEFT
-----------

This returns the amount of IPU that are left in this physics tick. This means
that if you receive the value 20, you can run 20 more instructions. After this
amount of instructions, other CPUs will run their instructions and then
`TIME:SECONDS` will increase.
This returns the amount of IPU (instructions per update) that are
left in this physics tick. For example, if this gives you the value
20, you can run 20 more instructions within this physics update
before the game will let the rest of the game run and advance time.
After this amount of instructions, other CPUs will run their
instructions, and the game will do the rest of its work, and then
`TIME:SECONDS` will increase and you'll get another physics update
in which to run more of the program.

Another way to think of this is "For the next ``OPCODESLEFT``
instructions, the universe is still physically frozen, giving
frozen values for time, position, velocity, etc. After that
it will be the next physics tick and those things will have moved
ahead to the next physics tick."

OPCODESLEFT can be used to try to make sure you run a block of code in one
physics tick. This is useful when working with vectors or when interacting
Expand Down
37 changes: 37 additions & 0 deletions doc/source/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,43 @@ release.

****

Changes in 1.4.0.0
------------------

CLOBBERBUILTINS
:::::::::::::::

The bugfix to prevent a local variable from clobbering a
builtin name could make existing scripts have to rename
a variable or two. As such there is now a compiler directive,
:ref:`@CLOBBERBUILTINS <clobberbuiltins>` to get the old
behavior back again. Use this if you don't want to rename any
variables in old scripts. But be warned that renaming those
variables, rather than using this directive, is probably the
better practice going forward.

Documentation now describes that comma separated ``LOCAL`` and
``SET`` declaration statements now allow initializers.

VESSEL SUFFIXES THRUST, ENGINES, RCS
::::::::::::::::::::::::::::::::::::

Added :attr:`VESSEL:THRUST`, :attr:`VESSEL:ENGINES`, and
:attr:`VESSEL:RCS`

OPCODESLEFT
:::::::::::

Added :ref:`OPCODESLEFT <opcodesleft>` bound variable

BINARY MODE FILE READ
:::::::::::::::::::::

Added :attr:`FileContent:BINARY` to let you read a binary
file as a LIST of numbers 0-255 for the byte values in the
file.


Changes in 1.3
--------------

Expand Down
4 changes: 2 additions & 2 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@
# built documents.
#
# The short X.Y version.
version = '1.3.2.0'
version = '1.3.3.0'
# The full version, including alpha/beta/rc tags.
release = '1.3.2.0'
release = '1.3.3.0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
4 changes: 2 additions & 2 deletions doc/source/structures/vessels/sciencecontainermodule.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ The type of structures returned by kOS when querying a module that stores scienc

Call this method to run the unit's "collect all" action

.. attribute:: ScienceExperimentModule:HASDATA
.. attribute:: ScienceContainerModule:HASDATA

:access: Get only
:type: :ref:`Boolean <boolean>`

True if this container has scientific data stored.

.. attribute:: ScienceExperimentModule:DATA
.. attribute:: ScienceContainerModule:DATA

:access: Get only
:type: :struct:`List` of :struct:`ScienceData`
Expand Down
Loading

0 comments on commit 9fab0b6

Please sign in to comment.