-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:KSP-KOS/KOS
- Loading branch information
Showing
332 changed files
with
22,337 additions
and
4,532 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ bin/ | |
obj/ | ||
*.suo | ||
packages/ | ||
/src/kOS.sln.ide |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
* All PRs must be related to an open issue | ||
* If a PR changes the scripting API, it must include all related changes to the documentation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
PART | ||
{ | ||
// --- general parameters --- | ||
name = kOSMachineRad | ||
module = Part | ||
author = Peter Goddard | ||
|
||
// --- asset parameters --- | ||
mesh = model/model.mu | ||
scale = 1 | ||
rescaleFactor = 0.99999999999 | ||
iconCenter = 0, 0, 0 | ||
|
||
// --- node definitions --- | ||
node_attach = 0.0, 0.0, 0.0, 1, 0, 0 | ||
|
||
// --- Tech tree --- | ||
TechRequired = unmannedTech | ||
|
||
// --- editor parameters --- | ||
cost = 2200 | ||
entryCost = 4200 | ||
category = Control | ||
subcategory = 0 | ||
title = CompoMax Radial Tubeless | ||
manufacturer = Squalid-State Devices Inc. | ||
description = Would you trust life and limb to a mindless autopilot, powered by untested software you hastily wrote yourself? Spacefaring kerbals would! | ||
|
||
// attachment rules: stack, srfAttach, allowStack, allowSrfAttach, allowCollision | ||
attachRules = 0,1,0,0,1 | ||
|
||
// --- standard part parameters --- | ||
mass = 0.03 | ||
dragModelType = default | ||
maximum_drag = 0.0 | ||
minimum_drag = 0.0 | ||
angularDrag = 0 | ||
crashTolerance = 6 | ||
maxTemp = 3400 | ||
|
||
|
||
MODULE | ||
{ | ||
name = kOSProcessor | ||
diskSpace = 60000 | ||
} | ||
MODULE | ||
{ | ||
name = ModuleDeployableSolarPanel | ||
sunTracking = false | ||
raycastTransformName = suncatcher | ||
pivotName = suncatcher | ||
isBreakable = false | ||
resourceName = ElectricCharge | ||
chargeRate = 0.5 | ||
powerCurve | ||
{ | ||
key = 206000000000 0 0 0 | ||
key = 13599840256 1 0 0 | ||
key = 68773560320 0.5 0 0 | ||
key = 0 10 0 0 | ||
} | ||
} | ||
} | ||
RESOURCE | ||
{ | ||
name = ElectricCharge | ||
amount = 10 | ||
maxAmount = 10 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
@PART[*] | ||
@PART[*]:FOR[kOS] | ||
{ | ||
MODULE | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
.. _addons: | ||
|
||
Addon Reference | ||
=============== | ||
|
||
This section is for ways in which kOS has special case exceptions to its normal generic behaviours, in order to accommodate other KSP mods. If you don't use any of KSP mods mentioned, you don't need to read this section. | ||
|
||
|
||
.. toctree:: | ||
|
||
Action Groups Extended <addons/AGX> | ||
RemoteTech <addons/RemoteTech> | ||
Kerbal Alarm Clock <addons/KAC> | ||
Infernal Robotics <addons/IR> | ||
|
||
To help KOS scripts identify whether or not certain mod is installed and available following suffixed functions were introduced in version 0.17 | ||
|
||
``ADDONS:AGX:AVAILABLE`` | ||
------------------------ | ||
|
||
Returns True if mod Action Group Extended is installed and available to KOS. | ||
|
||
|
||
``ADDONS:RT:AVAILABLE`` | ||
------------------------ | ||
|
||
Returns True if mod RemoteTech is installed and available to KOS. See more RemoteTech functions :doc:`here <addons/RemoteTech>`. | ||
|
||
|
||
``ADDONS:KAC:AVAILABLE`` | ||
------------------------ | ||
|
||
Returns True if mod Kerbal Alarm Clock is installed and available to KOS. | ||
|
||
|
||
``ADDONS:IR:AVAILABLE`` | ||
------------------------ | ||
|
||
Returns True if mod Infernal Robotics is installed, available to KOS and applicable to current craft. See more :doc:`here <addons/IR>`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
.. _AGX: | ||
|
||
Action Groups Extended | ||
====================== | ||
|
||
- Download: https://github.com/SirDiazo/AGExt/releases | ||
- Forum thread, including full instructions: http://forum.kerbalspaceprogram.com/threads/74195 | ||
|
||
Increase the action groups available to kOS from 10 to 250. Also adds the ability to edit actions in flight as well as the ability to name action groups so you can describe what a group does. | ||
|
||
Includes a Script Trigger action that can be used to control a running program and visual feedback if an action group is currently activated. | ||
|
||
**Usage:** | ||
Adds action groups AG11 through AG250 to kOS that are interacted with the same way as the AG1 through AG10 bindings in base kOS are. | ||
|
||
Anywhere you use ``AG1``, you can use ``AG15`` in the same way. (AG11 through AG250 explicitly behave the same as the 10 stock groups. Please file a bug report if they do not.) | ||
|
||
**Script Trigger action:** | ||
Installing AGX adds the "Script Trigger" action to all kOS computer parts. This action is a null action that does not activate anything but serves as a placeholder to enhance action groups in kOS. | ||
|
||
When an action group has the Script Trigger action assigned, on that action group you can now: | ||
|
||
- Name the action group so you remember what that action group does in your code when you trigger it. | ||
- Activate the action group with a mouse click on-screen, no more tying up your entire keyboard with various script trigger keys. | ||
- Enable group state feedback so you can have your script change the groups state as feedback as to what the script is doing. Green being On and Red being Off. (Toggle option in AGX.) | ||
|
||
|
||
**Basic Quick Start:** | ||
|
||
.. figure:: /_images/addons/AGExtQuickStart1.jpg | ||
.. figure:: /_images/addons/AGExtQuickStart2.jpg | ||
|
||
|
||
Note that this mod only adds action groups 11 through 250, it does not change how action groups 1 through 10 behave in any way and groups 11 through 250 should behave the same way. | ||
|
||
**Known limitations (Action groups 11 through 250 only):** | ||
|
||
- On a nearby vessel that is not your current focus, an action group with no actions assigned will always return a state of False and can not be set to a state of true via the "AG15 on." command. Assign the Script Trigger action as a work-around for this. | ||
- At this point, AG11 through AG250 do not officially support RemoteTech through kOS. (Support will happen once all three mods involved have updated to KSP version 1.0 and made any internal changes necessary.) All three mods can be installed at the same time without issue, just be aware there may be unexpected behaviour when using action groups 11 through 250 from a kOS script in terms of RemoteTech signal delay and connection state. | ||
|
||
**Action state monitoring** | ||
|
||
Note that the state of action groups is tracked on a per-action basis, rather then on a per-group basis. This results in the group state being handled differently. | ||
|
||
- The Script Trigger action found on the kOS computer module is not subject to the below considerations and is the recommended action to use when interacting with a running kOS script. | ||
- The state of actions are monitored on the part and updated automatically. A closed solar panel will return a state of false for all it's actions. (Extend Panels, Retract Panels, Toggle Panels) When you extend the solar panel with either the Extend Panels or Toggle Panels action, all three actions will change to a state of True. Retract the panels and the state of all three actions will become False. Note that this state will update in any action group that contains that action, not just the action group that was activated. | ||
- This can result in an action group have actions in a mixed state where some actions are on and some are off. In this case querying the group state will result in a state of False. For the purposes of the group state being True or False, if *all* actions in the action group are true, the group state will return true. If *any* actions in the group are false,the group state with return False. | ||
- When an action triggers an animation, the state of the action will be uncertain until the animation finishes playing. Some parts will report True during the animation and some will report False. It depends on how the part creator set things up and not something AGX can control. | ||
- For clarity, visual feedback can be provided of the current state of an action group. When editing action groups, find the "Toggle Grp." button just below the text entry field for the group name in the main AGX window and enable it. (It is enabled/disabled for the current action group when you click the button.) Once you do this, the text displaying that group will change from gray to colored. Green: Group is activated (state True). Red: Group is deactivated (state False). Yellow: Group is in a mixed state, will return a state False when queried. | ||
- It is okay to activate an already activated group and deactivate a non-activated group. Actions in the group will still try to execute as normal. Exact behaviour of a specific action will depend on how the action's creator set things up. | ||
|
||
**Example code:** | ||
|
||
Print to the terminal any time you activate action group 15. Use this to change variables within a running kOS script and the "Script Trigger" action found on the kOS computer part:: | ||
|
||
AG15 on. // Activate action group 15. | ||
print AG15. // Print action group 15's state to the terminal. (True/False) | ||
on AG15 { //Prints "Action group 15 clicked!" to the console when AG15 is toggled, either via "AG15 on." or in-game with an assigned key. | ||
print "Action group 15 clicked!". | ||
preserve. | ||
} | ||
|
||
|
||
**Animation Delay:** | ||
|
||
- Using the above code on a stock solar panel's Toggle Panels action, the player activates AG15, AG15's state goes from false to true and the actions are triggered. ``AG15 False -> True`` and prints to the terminal. | ||
- On it's next update pass (100ms to 250ms later), AGX checks AG15's state and sees the solar panel is still deploying which means that AG15's state is false and so sets it that way. ``AG15 True -> False`` and prints to the terminal. | ||
- A few seconds later, the solar panel finishes it's deployment animation. On it's next update pass AGX checks AG15's state and sees the solar panel is now deployed which means that AG15's state is now true and so sets it that way. ``AG15 False -> True`` and prints to the terminal a third time. | ||
|
||
As a workaround, you need to add a cooldown:: | ||
|
||
declare cooldownTimeAG15 to 0. | ||
on AG15 { | ||
if cooldownTimeAG15 + 10 < time:seconds { | ||
print "Solar Panel Toggled!". | ||
set cooldownTimeAG15 to time. | ||
} | ||
preserve. | ||
} | ||
|
||
Note the 10 in the second line, that is your cooldown time in seconds. Set this to a number of seconds that is longer then your animation time and the above code will limit whatever is inside the IF statement so it can only activate after 10 seconds have passed since the previous activation and will not try to activate a second time while the solar panel animation is still playing. | ||
|
||
|
||
|
||
|
Oops, something went wrong.